How to poke with response using DDE

I am trying to communicate with a windows application using the antiquated DDE interface, I know this interface has been overtaken by ActiveX but the application i am talking to (ZEMAX – optical modelling software) doesn't implement it.
I have managed to post requests to the application and receive responses, all successfully. However one of the functions that I need to implement requires passing a pointer to a data structure to the application, I have the c code equivalent but no idea how to implement it. I have been using the supplied dde.llb but can find no documentation for it.
This is the 'c' equivalent of the code i need to implement, can anyone help me with this???:
int PostArrayTraceMessage(char *szBuffer, DDERAYDATA *RD)
ATOM aItem;
HGLOBAL hPokeData;
DDEPOKE * lpPokeData;
long numbytes;
int numrays;
if (RD[0].opd > 4)
/* NSC Rays */
numrays = (int)RD[0].opd - 5;
else
/* sequential rays */
numrays = RD[0].error;
/* point to where the data is */
rdpGRD = RD;
ngNumRays = numrays;
numbytes = (1+numrays)*sizeof(DDERAYDATA);
hPokeData = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, (LONG) sizeof(DDEPOKE) + numbytes);
lpPokeData = (DDEPOKE *) GlobalLock(hPokeData);
lpPokeData->fRelease = TRUE;
lpPokeData->cfFormat = CF_TEXT;
memcpy(lpPokeData->Value, RD, numbytes);
/* clear the buffers */
szGlobalBuffer[0] = '\0';
szBuffer[0] = '\0';
aItem = GlobalAddAtom("RayArrayData");
GlobalUnlock(hPokeData);
if (!PostMessage(hwndServer, WM_DDE_POKE, (WPARAM) hwndClient, PackDDElParam(WM_DDE_POKE, (UINT) hPokeData, aItem)))
MessageBox (hwndClient, "Cannot communicate with ZEMAX!", "Hello?", MB_ICONEXCLAMATION | MB_OK);
GlobalDeleteAtom(aItem);
GlobalFree(hPokeData);
return -1;
GlobalDeleteAtom(aItem);
WaitForData(hwndClient);
strcpy(szBuffer, szGlobalBuffer);
/* clear the pointer */
rdpGRD = NULL;
if (GotData) return 0;
else return -1;
Thanks for your help.
Regards,
Tom

I'm not sure exactly what your code snippet is attempting, but if you are dependent on LabVIEW determining the pointer you probably are out of luck. There has been an ongoing thread in the last week regrading passing pointers to ActiveX and .NET so I won't belabor it too much other than to say that LabVIEW is running in its own memory space and isn't "aware" of what is in other code space. For a much better discussion look over the last few days (last week in particular) for the .NET/ActiveX discussions.
There may be solutions, there were a number of posts to that thread that I haven't looked at, like writing dll's that encapsulate the "offending code" and provide sort of a translation medium.
Good luck
P.M.
Putnam
Certified LabVIEW Developer
Senior Test Engineer
Currently using LV 6.1-LabVIEW 2012, RT8.5
LabVIEW Champion

Similar Messages

  • How to chat with people use AIM?

    i am use I-chat 4.0 ,mac OSx10.5.1
    how can u chat with people use AIM?
    he use can chat with people who is .mac or .aim.

    Hi
    For a Mac person just starting out on iChat, a good place to start is here:
    http://www.ralphjohnsuk.dsl.pipex.com/page2.html
    If AIM is being used by a Windows PC user then setting up as per http://www.ralphjohnsuk.dsl.pipex.com/page12.html#_Service is required.
    Steve

  • How to authenticate with MSISDN using REST style in openSSO

    I need authenticate with MSISDN using the REST style in openSSO.
    So, can anybody tells how to implement it? I am aware of implementing with username password by calling the URL as /opensso/identity/authenticate. If i want to authenticate using MSISDN how we have do it using REST in openSSO 8.0.

    Hi Vijay,
    I hope there is something related to MSISDN in the administrator Guide and Administrator Reference. Administrator reference contains the MSDN attribute lists. I found that in the Developer's guide, there is a documentation related to customising authentication modules where we can specify MSISDN authentication module. I guess there is a msisdn.xml file which can be can be configured.
    I am a new bee on this front. But I guess, we will find it out together. To what extent you have done to configure. Could you give me little detail about it. ;)
    Your message too short for the forum.
    Manila

  • How to work with BI using Visual Composer....?

    Hi
    I want to work with BI report and BEx analyzer etc using  Visual Composer.
    I am using Visual Composer 7.1. I  have configured BI system connection using the following link
    http://help.sap.com/saphelp_nwce10/helpdata/en/7e/6dbcea3700452195e3bddaa47c5906/frameset.htm.
    In the above document i didnt understand the following para....
    Creating BI Users in the Portal
    Ensure that the BI back-end users also exist in the J2EE Engine. You can use the BI back end as the user store for the J2EE Engine or you can create the users manually. If you create the users manually, you should ensure that they have the same names as in the BI back-end; this avoids the need to configure user assignment.
    How to check BI back end user also exist in J2EE engine ?
    How to use BI kit in Visual composer. From where can i download BI kit for Visual Composer.
    What is the difference between developing application in VC using the above method and using BI kit.
    Please help me....
    Regards
    Sowmya....

    Hi,
    Without the BI kit you cannot do a lot of things in VC 7.1.
    This kit is not available with 7.1.
    The part that you did not understand meant that if you opening VC using a certain id in portal for eg "user" then the same id should be present in your backend system in this case BW system.
    Without this it wont be able to connect to the system.
    Hope this helps
    Regards
    Nikhil.
    Reward points if you find the answer helpful

  • How to deal with the using up space of /opt/oracle

    Hello, all
    We have an Oracle 10g preinstalled in a linux server (Rh 9). Now the system reports that the /opt/oracle is using up. The alert says:
         Filesystem /opt/oracle has only 19% available space
    Because I didn't install the Oracle dababase, I didn't have the chance to select a place for filesystem. Now the /opt/oracle is on the /dev/sda6 which is only 7.1G. I want to know what kind of information are stored here? Should it keep growing? Our database running on the Oracle is a small one, and it shouldn't occupy so much space. By the way, I scheduled the backup to disk (another hard disk) everyday. Is there any copy of the backup on /opt/oracle? How can I deal with it?
    Any advice is highly appreciated!
    Qian
    Message was edited by:
    QianChen
    Message was edited by:
    QianChen

    Typically, the growth files on your binary directory is going to be in the $ORACLE_HOME/network/logs/listener.log , any tracelog, sqlnet.log, or any files that get accidentally dumped in $ORACLE_HOME/dbs.
    I would check there first.
    Also, try scanning for the last few files written/updated in the past 30 days.
    #30 biggest files modified in last little while:
    find . -xdev -type f -mtime -14 -exec ls -l {} \; | sort -nk 5,5 | tail -30

  • How to authenticate with Sharepoint using rest service and jquery

    Hi ,
    I have a requirement where i need to authenticate with  sharepoint from ios and android app using rest services and jquery.
    Can anyone help me in this .
    Thanks in Advance.
    Regards,
    Srinath 

    Hi,
    According to your post, my understanding is that you want to access SharePoint data from IOS and Android app.
    The following materials for your reference:
    How can I authenticate SharePoint REST calls from Android App?
    http://stackoverflow.com/questions/24673373/how-can-i-authenticate-sharepoint-rest-calls-from-android-app
    Calling RESTful services from your Android app
    http://www.techrepublic.com/blog/software-engineer/calling-restful-services-from-your-android-app/
    SharePoint 2013 REST API in iOS
    http://omicron-llama.co.uk/2012/12/13/sharepoint-2013-rest-api-in-ios/
    Best Regards
    Dennis Guo
    TechNet Community Support

  • How to edit with sed using a $var?

    NamePkg="mousekeywin-0.2.wm.tar.gz"
    Content of pkg.list
    desktopewmh-0.1.wm.tar.gz
    mousekeywin-0.2.wm.tar.gz
    rcwminit-0.1.1.wm.tar.gz
    How to remove line "mousekeywin-0.2.wm.tar.gz" with $NamePkg

    sed -e "s|$NamePkg||g" -i pkg.list
    will delete it but leave an empty space in place
    sed -e "/$NamePkg/d" -i pkg.list
    will delete the line completely

  • How to Authenticate with sharepoint using rest services

    I have a requirement where i need to authenticate with  sharepoint from ios and android app using rest services and jquery.
    Can anyone help me in this .

    You can use OAuth for authentication.
    http://msdn.microsoft.com/en-us/library/office/fp142382%28v=office.15%29.aspx

  • How to deal with " and '

    hi evry one, i have query that insert a text in a table. The problem is that the text contain these caracters : ' and ", so how to deal with them.

    Use PreparedStatement and setString. That should escape the single and double quotes properly for you.
    If you've got a String with double quotes in it you'll just have to escape it properly:
    public class DoubleQuoteTester
        public static void main(String [] args)
            for (int j = 0; j < args.length; ++j)
                System.out.println(args[j]);
    }Here's a typical run:
    java DoubleQuoteTester "I quoted the president as saying, \"I forgot!\"" "Quoth the raven 'Nevermore'"
    I quoted the president as saying, "I forgot!"
    Quoth the raven 'Nevermore'

  • How many PCs can I use with one Creative Cloud subscription?

    How many PCs can I use with one Creative Cloud subscription? For example I currently use Lightroom on a home PC with 2 large screens, but use a laptop or iPad when travelling. Does one monthly subscription cover all 3 or do I need 3 separate subscriptions ?

    You are welcome!
    P.S. when using the adobe forums, please mark helpful/correct responses of Staff or helper, if there are any. 

  • How to get the extension Info from firefox? Do we have any firefox API to communicate with the browser? I couldnt see the HTML of the widget displayed in the toolbar how to access the widget using JS or any way

    How to get the extension Info from firefox? Do we have any firefox API to communicate with the browser? I couldnt see the HTML of the widget displayed in the toolbar how to access the widget using JS or any way

    Hi,
    Thanks for the suggestion. I've been playing around with some of the classes of the java.net package and java.io
    Using the URL class i can get the content of the data from a STATIC page and output that response to file so that is does not display to the client broswer.
    But this only works if the URL i give points to a static html page.
    So the problem i'm getting is if i'm righting in arguments in the URL, this means that server needs to process the arguments i give and its sends back a dynamic result. Because its dynamic the URL class can not handle this and throws me an exception everytime :(
    Have u ever tried to do some things like this?
    Rahul

  • How Achieve timedseries calculations with out using AGO And ToDate function

    Hi,,
    1)
    How Achieve timedseries calculations with out using AGO And ToDate functionion
    this question asking in interview ..is it possible..?
    if yes please response as soon as possible..
    2) i have 2 cloumns Product and value...
    client requirement is they need ranks based on Value ..in dashboard .using dashboard prompt..edit box...if user enter any number (ex :5 ) report should show top 5 ranks if he enter 20 should be top 20 ranks..
    how to achive this ?
    thanks,
    raj

    Consider yor first question:
    1. Yes, we can create timeseries measures without using AGO and TODATE
    1. Create ALIAS of fact tabe in the physical layer
    2. Join the Time id from the ALIAS fact table with the YAGO_MONTH_ID column from your time dimension table (For calculating Year Ago variants) similarly join with MAGO_MONTH_ID column for Month Ago measures.
    3.Pull the ALIAS tables as an additional Logical table source in the Lgical layer
    4.Keep the mapping of the columns from the ALIAS table as its is
    5. For e.g If you pick Revenue from the Year Ago Alias table it will give you the "Prior Year Revenue"
    See if this helps you

  • How many Ipods can you use with one Itunes account?

    How many iPods can you use/sync with one iTunes account?

    PT wrote:
    Macistotle wrote:
    Unless you have DRM still haunting your tunes ... Then you can only use those songs on 5 devices. Otherwise, connect as many as you like (as stated above).
    No, you can sync your DRM tracks to an unlimited number of iPods (but only authorized to play on 5 different computers/user accounts)
    Patrick
    So I can sync two iPods to my iTunes account and sync the same digital copy movies that come with some o' my DVDs to both ipods? Do movies make a difference really, DRM-Wise? Thanks in advance.

  • Acmcneill1ug 14, 2014 7:16 AM I have IMac OSX 10.9.4, 4GB,Processor 3.06 with Intell2Duo. I would like to check for Malware. I run a TechTool Pro 6 every month and that comes up great. When check how much memory I am using, with only Safar

    Acmcneill1ug 14, 2014 7:16 AM
    I have IMac OSX 10.9.4, 4GB,Processor 3.06 with Intell2Duo. I would like to check for Malware. I run a TechTool Pro 6 every month and that comes up great.
    When check how much memory I am using, with only Safari open I am using 3.9 and more of her 4.0 memory. She is very. very slow in processing. I had 4000
    trash to clean out and it took her over an hour to expel. Also for some reason Safari will not allow me to click on a link, in my G-mail, and let it go to the page.
    It has a sign saying a pop-up blocker is on and will not let me do it. I must open the stamp to look at my e-mails and if I have redirected link now I can do it.
    I have not changed my preferences so where is this pop-up blocker?
    I have looked at preferences on Safari and Google, which I do not understand Google, and do not see where this blocker could be.
    Malware is something I want to make sure is not on my computer. Tech Tool Pro 6 is all I know of and it does not detect Malware.
    Help.
    Ceil

    Try Thomas Reed's Adware removal tool. He posts extensively in the communities.
    Malware Guide - Adware
    Malware Discussion

  • How do I view ipod music files with out using I tunes?

    I trying to view my Ipod music files without using itunes. But when I conect my Ipod to my pc I can only view contacts, notes, and caladar through the driver.
    How do I view ipod music files with out using I tunes?

    they should be under ur my music folder if u have windows

Maybe you are looking for