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
 Updating layers from a DLL in Origin 8

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
cjbf Posted - 09/20/2008 : 9:05:42 PM
For Origin 7.5 I wrote a DLL to send data to an Origin worksheet. It works fine, but now that I have Origin 8 I wish to use layers within a worksheetpage, and to send data to a specified column in a layer.
So how do I name the column when using WM_DLL_OPEN_DATA? In Origin 7.5 it's wksname_colname, but in Origin8Pro SR2 I've tried everything I can think of, having assumed it should be [wksname]layername!colname .
What am I doing wrong?

I use the following in the DLL to update an existing column (called AA) in wksname:
char tmp[512],colname[512];
unsigned long dw;
double FAR *lpDestination;
wsprintf(colname,"%s_%s",wksname,"AA"); // colname=wksname_AA in Origin 7.5, what in 8?
dw=SendMessage(hWnd,WM_DLL_OPEN_DATA,0,(LONG)(LPSTR)colname);
if (dw==0)
{wsprintf(tmp,"type \"Error: could not get memory address in Origin from DLL!\"");
SendMessage(hWnd, WM_USER, 0, (LONG)(LPSTR)tmp);
return;
}
lpDestination = (double FAR *)dw;
lpDestination[0]=12.3;//etc for other rows too
dw=SendMessage(hWnd,WM_DLL_CLOSE_DATA,1,(LONG)(LPSTR)colname); // 1 = data changed

Also, I have the following includes in the DLL C++ file:
#include "C:\Program Files\OriginLab\OriginPro75\ATI\include\labstr.h"
#include "C:\Program Files\OriginLab\OriginPro75\ATI\include\orgdll.h" //DLL related messages

I can't find the equivalent in Origin 8 Pro SR2, though orgdll.h is the only place I've found any documentation for the DLL messages. Where can I get them from?

Thanks in advance,
Chris.
2   L A T E S T    R E P L I E S    (Newest First)
cjbf Posted - 09/30/2008 : 07:37:06 AM
Thanks, Echo.
I've found just one name that works from a DLL, whereas all the others, that appear valid according to the Origin C test you suggested, do not work. I think that must be a bug.
The one that works is wksname_colname@layernumber , except if layernumber=1, in which case it has to be left out!
All the others give 0 as the address of the column.
So, problem solved, for me, byt it would be helpful to fix the bug or doument things better.
Echo_Chu Posted - 09/26/2008 : 11:06:09 PM
Hi, Chris

If in your assumption, wksname = workbook name, layername=worksheetname. Then it should be corret.

You can use following testing code to check whether the dataset exists in your Origin.


void test_in_80()
{
       Dataset ds("[Book1]Sheet1!A"); // note, the default name of book/sheet already change to Book1 and Sheet in 80
       if( ds )
              out_str("ok");
}

 
void test_in_75()
{
       Dataset ds("Data1_A");
       if( ds )
              out_str("ok");
}


I am sorry that we have removed ATI folder from 80. We are considering to bring it back in SR5.


Echo
OriginLab Corp

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