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
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 DLL could not be loaded

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
feson Posted - 03/10/2005 : 12:50:13 PM
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?
4   L A T E S T    R E P L I E S    (Newest First)
Klaus.Schm1 Posted - 04/11/2005 : 12:40:26 PM
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);
easwar Posted - 04/08/2005 : 5:12:04 PM
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

Klaus.Schm1 Posted - 04/08/2005 : 09:30:36 AM
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
easwar Posted - 03/14/2005 : 10:20:07 AM
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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000