ryan0270

I need to write a c++ dll that will be loaded by software running on Windows 95 from a VB-ish application. I have the .dll written and working on Windows XP and Windows 2000.

When I try to load the .dll in Windows 95 I get an error saying that the .dll could not be found. If I try regsvr32 c:\DLL.dll I an error "GetLastError return 0x00000485" which, according to MSDN, means that it could not find the .dll. Note that I don't actually need to register the .dll; I was just using regsvr32 to test if the problem was the VB-ish app or Windows.

Basically, is seems like Windows 95 isn't recognizing the file as a .dll. I only have VS2005 for development. Are there some settings that I need to adjust to allow Windows 95 to recognize it as a .dll I found a thread here that explains a procedure to make applications run in Win95 but it indicates that DLL's need a different set of changes. Can someon please explain what those changes would be

Thanks


Re: Visual C++ General Build dll in VS2005 to work on Win95

Sahir Shah

ryan0270 wrote:
Note that I don't actually need to register the .dll; I was just using regsvr32 to test if the problem was the VB-ish app or Windows.

If it's COM dll you need to register it. BTW, what's a VB-ish app

ryan0270 wrote:
Basically, is seems like Windows 95 isn't recognizing the file as a .dll. I only have VS2005 for development. Are there some settings that I need to adjust to allow Windows 95 to recognize it as a .dll I found a thread here that explains a procedure to make applications run in Win95 but it indicates that DLL's need a different set of changes. Can someon please explain what those changes would be

In that thread :

"However, if you want to use the DLL version of CRT on Windows 95 (similar to instructions given for NT 4 in the link OShah provided) you will also have to deal with InterlockedCompareExchangePointer function called in startup code of the CRT"

refers to using the CRT as a shared DLL instead of statically linking to it.





Re: Visual C++ General Build dll in VS2005 to work on Win95

Simple Samples

You need to look at the requirements for and other specifications of Visual Studio 2005. I am not sure, but I think it says that Windows 95 is not supported. If that is what it says, then don't expect Windows 95 to be supported. Anything that anyone says to get an executable built by VS 2005 to work using Windows 95 is as reliable as the person that provides that help and you must get support from them. Most people here won't try to help because they don't have the time and even if they might have something that might work they don't want to have to support what they do have.

If you really must support Windows 95 then you can get older copies of VC (I don't know how) or you might be able to use a different compiler.






Re: Visual C++ General Build dll in VS2005 to work on Win95

Simple Samples

I must say however that if Windows 95 can't find the DLL then probably the problem is that it can't find the DLL. Probably the problem is the obvious problem and you simply are expecting something more complicated.






Re: Visual C++ General Build dll in VS2005 to work on Win95

ryan0270


To Sahir Shah:
This .dll has no COM component. It is a bunch of matrix calculations that does not lend itself well to being written in the VB-ish application. FYI, the VB-ish app is a proprietary robot control environment. The commands are all based on VB, but technically I don't believe it is VB

To Simple Samples:
I am aware that Win95 is no longer supported. Unfortunately the .dll will need to run on machines with Win95 and the only dev software that I have right now is VS2005. I am looking for a copy of VS6 but I don't know yet if I'll find one.

I guess I don't understand what your last post is about. Sorry, but I'm a mechanical engineer by training with only a minor in computer science. Our group recently lost our software engineer so I'm having to play with this stuff on my own.

Thanks




Re: Visual C++ General Build dll in VS2005 to work on Win95

Sahir Shah

ryan0270 wrote:

This .dll has no COM component. It is a bunch of matrix calculations that does not lend itself well to being written in the VB-ish application. FYI, the VB-ish app is a proprietary robot control environment. The commands are all based on VB, but technically I don't believe it is VB

You don't need to register it if isn't a COM dll. Where is your dll located Is it's location listed in the path variable Please see http://msdn2.microsoft.com/en-us/library/ms682586.aspx for more information on this. Presume you have no dependency other than CRT and you are using static linking to CRT with the changes mentioned in Ted's post.





Re: Visual C++ General Build dll in VS2005 to work on Win95

ryan0270

I'm pretty sure the path isn't the problem. There are other .dll's being loaded ok (even if I change their names). Unfortunately, those are legacy .dll's and I'm not sure how they were created.




Re: Visual C++ General Build dll in VS2005 to work on Win95

Simple Samples

That is a very common cause of problems; that is, assumptions. One time someone insisted there was no explanation for why the program could not find the file, but they eventually realized that the file was in a directory different from where their program was looking for it.






Re: Visual C++ General Build dll in VS2005 to work on Win95

ryan0270

Agree, this can lead to many problems but I've done everything I can to test it. If path was a problem I would have expected regsvr32 c:\DLL.dll to work since the path is stated explicitly.




Re: Visual C++ General Build dll in VS2005 to work on Win95

Sahir Shah

ryan0270 wrote:
Agree, this can lead to many problems but I've done everything I can to test it. If path was a problem I would have expected regsvr32 c:\DLL.dll to work since the path is stated explicitly.

Ryan, regsvr32 c:\MyDLL.dll will fail if MyDLL.dll isn't a COM dll. What is the method used by the VB application to load the dll





Re: Visual C++ General Build dll in VS2005 to work on Win95

ryan0270

Oh, I wasn't aware that regsvr32 would fail for that specifically. The fail code that I've been getting is the fail code associated with not finding the .dll. When I try regsvr32 on a Win2K or WinXP machine I get a different error code (I assume associated with the lack of COM components), but it does find it. My guess is that the error related to not finding the DLL is coming before the error related to not finding the COM components.

I am not sure what method is used by the VB app itself to load the .dll. The software is an environment and the code I write in it I assume is interpreted instead of compiled. The line of code I write is:
DECLARE func,"DLL.dll","funcInsideDLL",(integer) as double






Re: Visual C++ General Build dll in VS2005 to work on Win95

ryan0270

Well, I finally found a copy of VS6. After clearing out the intiial errors it compiled and is loaded ok.




Re: Visual C++ General Build dll in VS2005 to work on Win95

Simple Samples

Did anyone suggest using a previous version of VC If anyone made a suggestion that was relevant to the soluton then it is appropriate to mark that as an answer too. I forget what all I said but it does not matter who it was; you can decide.

That is not what I was going to say; the important thing I was going to say is that the source code for regsvr32 is provided as a SDK sample. The utility has many options but the important thing it does is to call the DllRegisterServer or DllUnregisterServer in the DLL. Most everything important is done by the DLL itself. So the important two reasons for regsvr32 to fail is that it either can't find the file or calling the function fails.

I forget the errors you were encountering but I think they meant there was a problem with the runtime for VC 2005. Since it was so difficult to be sure what the real problem was it was not clear how to fix the problem. It might work to use VC 2005 and create a useful setup for the DLL.