The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 DLL could not be loaded
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

feson

Germany
Posts

Posted - 03/10/2005 :  12:50:13 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): Pro 7 SR2
Operating System: Windows XP Professional

Hello,

I've a problem with a MFC DLL which I want to load into Origin. This DLL has serveral functions; one of them is:
bool getMeasurementSMValue(void *data,
unsigned long ulWaferID,unsigned int sampleNo,
unsigned int semanticID,
unsigned int cycleNo, double *pdbValue,
double *pdbStanDev,unsigned int *nofOLEDs);

When I want to build the Origin C files, I get the error that the linker cannot found the above function. But this function exists; and all other functions of this DLL can be linked without any problem.

The DLL works fine with Origin 7G and Origin 7.5

What do I make wrong?

easwar

USA
1965 Posts

Posted - 03/14/2005 :  10:20:07 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

We created a test DLL with functions that have the same prototype as yours and we were able to load and access the functions in the DLL in all versions including 7SR2.

So not sure what the specific problem could be with your DLL. I suggest you contact tech support directly to discuss further.

Easwar
OriginLab




Edited by - easwar on 03/14/2005 10:20:54 AM
Go to Top of Page

Klaus.Schm1

Germany
4 Posts

Posted - 04/08/2005 :  09:30:36 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Had the same problem.

Seems to be linked to using DLL's who themself depend on other dll's or possibly to dll's that contain C++ code I don't know.
There seems to be a bug in the DLL loading system because also data sometimes gets corrupted when calling functions through origin.

Found a workaround (which worked for my case anyway):

Say you want to include a dll called testA.dll who internally depends on TestB.dll

in the header file where you declare all the functions from testA.dll you want to call put in the very first line

#pragma dll(TestB.dll)
#pragma dll(TestA.dll)

Now before you compile change that to: (yes comment out the TestA.dll)

#pragma dll(TestB.dll)
// #pragma dll(TestA.dll)

Compile once (Gives you an error of course)

Now change to

#pragma dll(TestB.dll)
#pragma dll(TestA.dll)

Compile again and everything should work fine.

Don't ask me why but thats the only way I got it to work for me.

Hope that helped
Go to Top of Page

easwar

USA
1965 Posts

Posted - 04/08/2005 :  5:12:04 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:

Had the same problem.

Seems to be linked to using DLL's who themself depend on other dll's or possibly to dll's that contain C++ code I don't know.
There seems to be a bug in the DLL loading system because also data sometimes gets corrupted when calling functions through origin.

Found a workaround (which worked for my case anyway):

Say you want to include a dll called testA.dll who internally depends on TestB.dll

in the header file where you declare all the functions from testA.dll you want to call put in the very first line

#pragma dll(TestB.dll)
#pragma dll(TestA.dll)

Now before you compile change that to: (yes comment out the TestA.dll)

#pragma dll(TestB.dll)
// #pragma dll(TestA.dll)

Compile once (Gives you an error of course)

Now change to

#pragma dll(TestB.dll)
#pragma dll(TestA.dll)

Compile again and everything should work fine.

Don't ask me why but thats the only way I got it to work for me.

Hope that helped




Hi,

Can you post the prototype of the function exported from the DLL so that we can test this?

Thanks,

Easwar
OriginLab

Go to Top of Page

Klaus.Schm1

Germany
4 Posts

Posted - 04/11/2005 :  12:40:26 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Here you go: The Origin C header files
If you want I can also send you the DLL's to load and a
sample project so you can test it fully

 
// Header file for origin

// Load the external DLL
#pragma dll(C:\Dokumente und Einstellungen\skl.IPP\Eigene Dateien\Visual Studio Projects\Diffusion\OriginStub\Release\Diffusion.dll)
#pragma dll(C:\Dokumente und Einstellungen\skl.IPP\Eigene Dateien\Visual Studio Projects\Diffusion\OriginStub\Release\OriginStub.dll)

// Interface for origin

// Set the current diffuion profile
int SetDiffusionProfile(double* pX, double* pC, int NumLayers);

// Returns the number of layers in the current diffusion profile
int GetNumLayers(void);

// Gets the C(X) diffusion profile data
int GetDiffusionProfile(double* pX, double* pC, int* pNumLayers, int MaxLayers);

// Set the current D(C)
int SetDofC(double* pC, double* pD, int NumEntry);

// Get the number of entries in the current D(C)
int GetNumDofCEntries(void);

// Get D(C)
int GetDofC(double* pC, double* pD, int* pNumEntry, int MaxEntries);

// Runs the diffusion code

// Constant D
int DiffusionProfileDConst(double D, double dt, int NumSteps, double MinVal, double MaxVal);

// Uses the current D(C)
int DiffusionProfileDofC(double dt, int NumSteps, double MinVal, double MaxVal);

// Performs BM-Analysis
int BMAnalysis(double Time, int MaxSteps, double Acc);
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000