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
 LabTalk Forum
 Labtalk DLL interface
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Peter Rijnbeek

Netherlands
Posts

Posted - 06/25/2009 :  06:55:50 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): Origin Pro SR5
Operating System: Windows XP

Hi,

I have to update a DLL which I use to perform external calculation on data from a worksheet in Origin. My previous version worked correctly in Origin 5.0.

I have linked the new Outl60.dll (lib) and the new labstr.h and orgdll.h. The compilation worked out fine. However, when i want to run the dll in origin using: DLL binom MOMENT Windowfit_res %L%NWTT $(k); I get the message the procedure could not be found (error 127).
I looks like the MOMENT procedure in the dll could not be found for some reason.

Can anybody help me with this problem? Has there been changes in the interface for the DLL?

I use:

BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
{

return TRUE;

}

int FAR PASCAL MOMENT(HWND hWnd,LPSTR lpString);

int FAR PASCAL MOMENT(hWnd,lpString)
HWND hWnd;
LPSTR lpString;

/* Calculation of mean,average, stdev, var, skew, curt */
{

CODE

}

Thanks for you help

Peter

eparent

118 Posts

Posted - 06/25/2009 :  12:12:45 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Have you verified the function was exported properly? The tools dumpbin and depends are handy for doing this. Without having your DLL we can not verify that for you.

The following shows how to structure your code so the functions are exported properly and callable from LabTalk. The code below is simplified for demonstration purposes but will compile fine in Visual C++ and CodeBlocks with GCC.


//---------- main.h

#ifndef __MAIN_H__
#define __MAIN_H__

#include <windows.h>

#ifdef __cplusplus
extern "C"
{
#endif

int __declspec(dllexport) MOMENT(HWND hWnd, LPSTR lpString);

#ifdef __cplusplus
}
#endif

#endif // __MAIN_H__


//---------- main.cpp

#include "main.h"

BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
{
	return TRUE;
}

//int FAR PASCAL MOMENT(HWND hWnd,LPSTR lpString);

int __declspec(dllexport) MOMENT(HWND hWnd, LPSTR lpString)
{
	return 0;
}
Go to Top of Page

Peter Rijnbeek

Netherlands
Posts

Posted - 06/29/2009 :  04:05:53 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I have tried this also and it will compile in Visual C++ just as the version as described by myself but origin still gives the error that the procedure cannot be found in de DLL???
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