Archived

This topic is now archived and is closed to further replies.

Windows XP and DLLs

This topic is 5090 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Just wondering if anyone has ever come accross this problem: The program loads dlls as plugins. The plugins are kept separately from the main program. Everything compiles and runs and the program runs fine in Windows XP Home edition. When you go to any other os (including professional edition) the program cant load the dll files. Unfortunately i cant post any code...sry. Just wondering if you guys may have any ideas as to what the problem is. TIA

Share this post


Link to post
Share on other sites
When you say that it runs fine in Windows XP Home, does that mean it works on all computers running Windows XP Home or just 1 computer running Windows XP Home?

If your answer is just 1 computer, then my next question would be if this is the computer you compiled/developed your program on.

Share this post


Link to post
Share on other sites
I doubt it is an OS problem. What is more likely is that you are missing some dependencies. Download and run Dependency Walker[1] on the plugin DLLs(on the target system, of course). This will tell you which additional DLLs you need to redistribute - most likely the C or C++ runtime.

[1]www.dependencywalker.com

--
AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.
[Project site] [Blog] [RSS] [Browse the source] [IRC channel]

Share this post


Link to post
Share on other sites
quote:
Original post by Steelrose
Because of the way different OS''s do things, you need to compile on each OS so the OS can read it correctly.

A kind suggestion: Don''t give any more advice on these forums. Ever.

Share this post


Link to post
Share on other sites
quote:
Original post by Arild Fines
quote:
Original post by Steelrose
Because of the way different OS''s do things, you need to compile on each OS so the OS can read it correctly.

A kind suggestion: Don''t give any more advice on these forums. Ever.



Do you get off on making fun of people? Does it make you feel like a bigger man? You learned at one point too. Why dont you not post until you learn some manners. There is no reason for comments like that on this fourm. If you have to fulfill some need of yours by saying things like above, go to some general fourm where nothing is taken seriously.


"What we do in life, echos in eternity" -- Gladiator

Share this post


Link to post
Share on other sites
quote:
Original post by SkinnyM
quote:
Original post by Arild Fines
quote:
Original post by Steelrose
Because of the way different OS''s do things, you need to compile on each OS so the OS can read it correctly.

A kind suggestion: Don''t give any more advice on these forums. Ever.



Do you get off on making fun of people? Does it make you feel like a bigger man? You learned at one point too. Why dont you not post until you learn some manners. There is no reason for comments like that on this fourm. If you have to fulfill some need of yours by saying things like above, go to some general fourm where nothing is taken seriously.


"What we do in life, echos in eternity" -- Gladiator


It is generally a bad idea to shoot off ones month at a far more experienced member. Arild Fines''s comment, while obviously harsh, was completely justified. The advice given by the poster in question was complete and utter bullocks (translation: It was wrong in many ways, and generally horrible advice to give. If the user has other posts like this it may even suggest they are intentionally trolling)

Share this post


Link to post
Share on other sites
I will stop after this post because i really like to ask questions on this fourm. You are right, he is a far more experienced member than me, the point i was trying to make is i believe this fourm is bigger then petty insults at people who for all you know, are completely serious and just trying to help.

People give wrong answers all the time, they are trying to help. This case was no different until a insult was thrown that has no place here. But i will be quiet and hopefully i wont get banned from these fourms because i really enjoy them.



[edited by - SkinnyM on January 6, 2004 10:59:50 PM]

Share this post


Link to post
Share on other sites
quote:
Original post by SkinnyM
people who for all you know, are completely serious and just trying to help.

That''s what scares me the most. People shouldn''t "try to help" at all if they have no clue what they are talking about. Other people who are learning will not recognize the fact that the advice is completely and utterly clueless and actually take it seriously.

In this case, the advice was so bad that it made me angry, and I felt that some amount of harshness was warranted. If the reply had included some disclaimer to the effect that the poster might not actually know what he was talking about, I wouldn''t have spoken up, and merely pointed out how inaccurate it was.

Bad advice is worse than no advice at all. The road to hell is paved with good intentions etc etc...

Share this post


Link to post
Share on other sites
Okay look fokes, I was trying to help in a way I thought was correct. If I was misinformed then I''m sorry, but if you fokes believe that trying to cut down someone on a forum is a boost to you ego, then by all means go for it. I really don''t care, I''m only trying to help out. If you don''t wish me to then I won''t, I''ll just post question''s. And BTW, If anyone puts up a stupid answer to a question, I''ll be sure to notice it.

As for my earler post, I was correct. I had thought llvllatrix was trying to take his program to another OS such as Linux.

quote:

When you go to any other os



I was mistaken. The only problem I can see with the program in question is the compiler is compiling in debug mode and not release mode. This would cause the program to not run because of it looking for dll''s that arn''t there. To fix this in VC6 and VC7 you need to go to Build->Set active configuration->set to release. Then try to recompile and take to another computer. If the issue is with BBuilder the idea is the same but it''s been awhile since I worked with it so I can''t remember where to change the settings.

Share this post


Link to post
Share on other sites
ok I just want to point somthing out to the "you have to compile on different os''s to make it work" (sorry I didn''t want to to quote)*note after re-reading the actual post I can see where it can be taken as differnt os venders not just os''s in the ms family. For the Windows XP family there should be no need to recompile for home/profesional/2000 and unless you use nt specific code you can use it on 98 etc. So recompiling on EVERY differnt os will have no meaning if you are using the same os "family" with the same basic kernel. I don''t mean to sound harsh or mean but I agree with Arild on this one, if you don''t know the anser or don''t read and understand the question don''t post or at least only post a "I don''t understand the question please elaberate" or else you will get flamed and possibly give bad advice without meaning to.

Share this post


Link to post
Share on other sites
Heres the deal:

I was called in to work on an app and the first thing they want me to do is fix this bug. The app was developed on xp home edition and uses several plugins. When the program was compiled and distributed it didnt seem to work on any other os but xp home. They say it didnt work on xp pro. I also have no way to know if the debug was what was distributed but im sure it was the release...ill see if i can get u more info.

thx for the help

Share this post


Link to post
Share on other sites
djkno3 - In this area you are correct, except for a small number of dlls (1 or 2 but MS will never admit that) that are not found on XP Pro and not on XP home. I haven''t had any problems with it. It''s mostly security related stuff anyway.

llvllatrix - Humm, this is a problem. I had thought that the program in question was one you created yourself. The only thing I can suggest is to call the program vender if it comes from a third party or talk to the programmers if it was done in-house and find out what dlls are needed and where you can get a copy of them.

I haven''t heard of www.dependencywalker.com but I hope it works for you.

Share this post


Link to post
Share on other sites
llvllatrix,

When they redistributed it, did they add the plugins into a subdirectory or something?? I''ve made this very common mistake too many times, that is the dll''s are not in a location that windows can find them.

Have no fear, debug/release doesn''t matter, and a program that uses dll''s is backwards compatible, so down to 98 should be able to use it.

-brad

Share this post


Link to post
Share on other sites
quote:

When they redistributed it, did they add the plugins into a subdirectory or something?? I''ve made this very common mistake too many times, that is the dll''s are not in a location that windows can find them.



That is exactly what they did; actually that is what i''ve been trying to trace all day with little luck. Im probably going to end up rewriting the dll loader so that it can load whatever dlls are in the programs directory (sort of like what milkshape does). The program has to be distributed right now though...can u describe what your past experiences were like?

Share this post


Link to post
Share on other sites
I seem to have solved the problem. For some reason the last programmer placed a "\\\\?\\" before the path of the dlls (the path following was complete and correct). Not sure why he did it but when i removed it the program ran perfectly. Anyone know what "\\\\?\\" is?

Share this post


Link to post
Share on other sites
I think, I''m not positive, but I think they were trying to tell the compiler to look in either the default directory or the current directory, possibly the drive letter.

I know that when you use directories in a string you need to add an extra slash, ie. "home//personal//data". This is due to c++ using the ''/'' key to activate functions within the string such as newline or the like. So if this is the case then they added too many slashes.

Share this post


Link to post
Share on other sites
quote:
Original post by Steelrose
I know that when you use directories in a string you need to add an extra slash, ie. "home//personal//data". This is due to c++ using the ''/'' key to activate functions within the string such as newline or the like. So if this is the case then they added too many slashes.

You don''t learn, do you? GRRR!

\\?\ represents the root of the Windows file system, and can be used to access files with otherwise inaccessible names as "con" or "nul". \\?\C:\windows is equivalent to C:\windows.

The documentation for CreateFile states for the filename argument:

In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide characters, call the Unicode version of the function and prepend "\\?\" to the path.


See Naming a volume[MSDN] for more information.

--
AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.
[Project site] [Blog] [RSS] [Browse the source] [IRC channel]

Share this post


Link to post
Share on other sites