Solved

Problems with C++ DLL  on Server 2000 vs XP

Posted on 2007-11-26
9
171 Views
Last Modified: 2013-12-05
I added some functionality to a C++ DLL which originally ran fine on a Server 2000 machine.  After adding the new functionality the DLL runs fine on Windows XP, but now it doesn't return and times out when it is run on Server 2000.  Is there any common functionality issues or gotchas that I need to watch out for when creating a DLL on XP for Server 2000?  Would upgrading the environment to Server 2003 be likely to fix the problem?

While adding the new functionality, the only major thing that I used that the previous version did not is a new struct I created.  The rest of it just uses functions and data types that were already in use.

It is difficult for me to debug the DLL since another 3rd party software application is calling the routine during it's execution.  Does anyone have any ideas off the top of their head on what it could be?

Thanks for any and all help.

--Charly
struct RA_STRING

{

	unsigned long Len;

	char  Data[82];

};

Open in new window

0
Comment
Question by:dleehanson
  • 4
  • 3
  • 2
9 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 20350829
1st of all: What error are you getting? "Does not run" can stand for a lot...
0
 
LVL 39

Expert Comment

by:itsmeandnobodyelse
ID: 20350912
>>>> After adding the new functionality the DLL runs fine on Windows XP
As the dll depends on other dlls, the executable built in a XP environmemnt now may load different dlls than when you build it at 2000 server. For example it may call some UNICODE dlls or registered COM dlls which have different versions for XP as they have for 2000 Server. Moreover, an XP executable may run with a .manifest which contains taken-out registry information while that information is not available in a 2000 Server environment.

>>>> struct RA_STRING
That struct most likely isn't the reason, beside you would have different alignment in two dlls using that struct.

Regards, Alex
0
 
LVL 1

Author Comment

by:dleehanson
ID: 20351003
I'm not on-site right now, but The 3rd party application's watchdog timer would expire after a set amount of time when the called DLL routine wouldn't return control.  I'm pretty sure it had enough time to properly execute since on my XP machine it took about 50ms, and I was allowing 2000ms before the watchdog timer fault would fire.  I'm not getting any runtime errors from the OS or anything like that, the routine just isn't returning after it is called.

I know that I am being very vague, and I apologize for that.  I was just looking for any common problems or things I need to watch out for when moving a DLL from XP to Server 2000?  I thought I would just check with the experts to see if there is any common problems to check before I go about trying to find a way to debug the DLL routine as it is called from the 3rd party application, which has no debugging mode or tools :(

I'm compiling the DLL for the machine via a Visual Studio 2005 generated installer if that matters...

Thanks.

--Charly
0
 
LVL 86

Accepted Solution

by:
jkr earned 125 total points
ID: 20351026
>>which has no debugging mode or tools :(

You can try the DependencyWalker (www.dependencywalker.com) in "Profile" mode and check the output, that already reveals a lot.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 39

Assisted Solution

by:itsmeandnobodyelse
itsmeandnobodyelse earned 125 total points
ID: 20351265
>>>> I'm compiling the DLL for the machine via a
>>>> Visual Studio 2005 generated installer if that matters...

Visual Studio 2005 generates a .manifest file that doesn't work on 2000 Server (afaik). You may search for build options to not creating a manifest.

Can't you build a separate version using a 2000 Server environment? Or on a W2k ? Maybe with a VC6 or VC7.1 compiler (or that one that worked in the past)?
0
 
LVL 1

Author Comment

by:dleehanson
ID: 20352176
Alex,

I'm setting up a machine for it right now in the shop.  I did some searching, and at first glance it looks like I need to generate a Merge Module for my DLL instead of a windows installer.  I have to read up on it more though, since I haven't done this before.

jkr,

That is a neat program!  All I get for referenced modules with both the original and the new DLL is:

Kernel32.dll
 - NTDLL.dll

I think my issue is somewhere with building it on Server 2000 like Alex has suggested, but I'll need to dig into it some more to find out for sure.  Once I get my test rig up-and-running I'll try making a merge module and see how that works.

--Charly
0
 
LVL 86

Expert Comment

by:jkr
ID: 20352415
Also try the "Profile" mode, the logging is pretty useful.
0
 
LVL 1

Author Comment

by:dleehanson
ID: 20365761
It looks like we are going to upgrade to Server 2003.  Am I still going to run into the manifest problem with 2003?  I don't really know what to search for to find out myself...

Thanks.

--Charly
0
 
LVL 1

Author Comment

by:dleehanson
ID: 20366736
I think I am going to open another question, since my problems have changed somewhat.  Thanks for the help guys.

--Charly
0

Featured Post

Do email signature updates give you a headache?

Do you feel like you are constantly making changes to email signatures? Are the images not formatting how you want them to? Want high-quality HTML signatures on all devices, including on mobiles and Macs? Then, let Exclaimer solve all your email signature problems today.

Join & Write a Comment

On a regular basis I get questions about slow RDP performance, RDP connection problems, strange errors and even BSOD, remote computers freezing or restarting after initiation of a remote session. In a lot of this cases the quick solutions made b…
Remote Apps is a feature in server 2008 which allows users to run applications off Remote Desktop Servers without having to log into them to run the applications.  The user can either have a desktop shortcut installed or go through the web portal to…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now