?
Solved

Problems with C++ DLL  on Server 2000 vs XP

Posted on 2007-11-26
9
Medium Priority
?
177 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

 
LVL 86

Accepted Solution

by:
jkr earned 500 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
 
LVL 39

Assisted Solution

by:itsmeandnobodyelse
itsmeandnobodyelse earned 500 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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Some time ago I faced the need to use a uniform folder structure that spanned across numerous sites of an enterprise to be used as a common repository for the Software packages of the Configuration Manager 2007 infrastructure. Because the procedu…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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.

762 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