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
 How to use my external DLL in X-Function?

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
Alex-qwerty Posted - 12/05/2010 : 03:39:57 AM
OriginPro 8.1 SR3 Operating System: WinXP SP3
I have my own DLL that I can use in OriginC, and I can use it in OriginC.
Files "MyDLL.dll" and "MyDLL.h" are located in the same folder as my Origin project that uses this DLL. But functions from my DLL are accessible just from this project.
Now I want to use this DLL in my user X-Function, for accessing my DLL functions fron any project.
Is it possible?
I tried to compile my X-Function, but have compiler message:
"Error, include file not found"
I try to put include file "MyDLL.h" as in folders with my X-Function:
"...\Documents and Settings\...\OriginLab\81\User Files\X-Functions\Miscellaneous\"
as in folders:
"C:\Program Files\OriginLab\Origin81\OriginC\OriginLab\"
"C:\Program Files\OriginLab\Origin81\OriginC\System\"
but always get message "Error, include file not found".
Is there a way to use my DLL in user X-Function?
3   L A T E S T    R E P L I E S    (Newest First)
Alex-qwerty Posted - 12/06/2010 : 10:42:51 AM
Many thanks for Penn!
It works!
Penn Posted - 12/06/2010 : 02:23:12 AM
Hi,

Please refer to our Origin C document about how to Include Header Files and Access an External DLL.

In your issue, you can try to put both your "MyDLL.h" and "MyDLL.dll" in the folder "OriginC\X-Functions", which is under the User Files Folder. In the "MyDLL.h" header file, need the following line to specify the location of the dll.

#pragma dll(MyDLL, header) //in the same folder as this .h file

Then in the X-Function, include the header file like:

#include "MyDLL.h"


Penn
Alex-qwerty Posted - 12/06/2010 : 01:09:37 AM
One of cases abowe start working after Origin restart:
I put file "MyDLL.h" in
C:\Program Files\OriginLab\Origin81\OriginC\Systemand "MyDLL.dll" in
C:\Program Files\OriginLab\Origin81and type in my X-Function #include <MyDLL.h>
and restart Origin.
After that my X-Function begin to compile and work normally.
But all these folders are Origin system folders.
So, the qwestion now is: Is there a way to use a Origin user folders for storing "MyDLL.h" and "MyDLL.dll"?

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