Can not pass CString variable as value argument to exported function in library

I have extension library having following function exported
__declspec(dllexport) int MyMessageBox(CString & csText, CString csCaption, const int iMsgType);
The linker error is coming for second argument when I try to call the function from client.
 error LNK2001: unresolved external symbol "int __cdecl MyMessageBox(class ATL::CStringT<unsigned short,class StrTraitMFC_DLL<unsigned short,class ATL::ChTraitsCRT<unsigned short> > > &,class ATL::CStringT<unsigned short,class
StrTraitMFC_DLL<unsigned short,class ATL::ChTraitsCRT<unsigned short> > > &,int)" (?MyMessageBox@@YAHAAV?$CStringT@GV?$StrTraitMFC_DLL@GV?$ChTraitsCRT@G@ATL@@@@@ATL@@0H@Z)
I have checked project settings for both(client as well as DLL) and I think it may not an issue as both are using same character set and linker settings.
Please help. 

On 3/26/2015 9:01 AM, AtulPP wrote:
I have extension library having following function exported
__declspec(dllexport) int MyMessageBox(CString & csText, CString csCaption, const int iMsgType);
The linker error is coming for second argument when I try to call the function from client.
  error LNK2001: unresolved external symbol "int __cdecl MyMessageBox(class ATL::CStringT<unsigned short,class StrTraitMFC_DLL<unsigned short,class ATL::ChTraitsCRT<unsigned short> > > &,class ATL::CStringT<unsigned short,class
StrTraitMFC_DLL<unsigned short,class ATL::ChTraitsCRT<unsigned short> > > &,int)" (?MyMessageBox@@YAHAAV?$CStringT@GV?$StrTraitMFC_DLL@GV?$ChTraitsCRT@G@ATL@@@@@ATL@@0H@Z)
Use Dependency Walker (http://www.dependencywalker.com/) or dumpbin to discover the decorated name under which the function is actually exported from the DLL, compare with the one the linker
is complaining about.
What compiler version are you using? Seeing "unsigned short" where one would expect wchar_t is suspicious. VC6 did that (lacking a built-in wchar_t type), but it wouldn't have things like StrTraitMFC_DLL. I suspect you are building one of the
two modules with /Zc:wchar_t- (Project > Properties > C/C++ > Language > Treat wchar_t As Built-in Type = No).
Igor Tandetnik

Similar Messages

  • How can i pass a variable's value from PR to PFR

    Dear all,
    hope you are fine.
    i would like to pass a variable's value from PR to PFR.
    how can i do that.
    please suggest.
    in PR:
    String transactionId = (String) vo_trans.first().getAttribute("Getnexttrans");
    i would like to get this value to PFR.

    Mofizur,
    You can achieve the same using Session variable.
    If u are not executing the VO after PR. Then you will be able to get the same value as u are using in PR
    String transactionId = (String) vo_trans.first().getAttribute("Getnexttrans");
    Note - You have a few of the threads left open, mark it as answered if solved.
    Regards,
    Gyan

  • Can we Pass two variable values in to one Varaible which is Cust Exit?

    Hi all,
    Can we pass two Variable values to a Variable which is Custexit?(For Example posting Period and the fiscalyear in to the FicalPeriod )
    Regards
    Kiran

    Hello,
    For that example you had to "convert" both post period and fiscalyear into fiscalperiod, and yes it is possible, but not throwing up the two values, you had to do it yourself in the user exit code.
    Diogo.

  • How can we pass the select-option value to modulepool program?

    hi,
      how can we pass the select-option value to modulepool program ?
      Because if i declared select-options in executable program and i used SSCRFIELDS to define push buttons in selection screen.
               My requirement if enter the values to select-options and press UPDATE pussbotton then i want call screen which contains tablecontrol.
               How i get select-option values to PAI of call screen for getting the data from database table to my internal table?

    Oh I thought that you have selection-screen and again you are working on dialog programming.
    if you want to use select-option directly in module pool then it is not possible.
    but you can do other way.
    create two varaiables
    data : v_kun_low like kna1-kunnr,
             v_kun_high like kna1-kunnr.
    use these two variables in layout ,let user knows that he can not give options like gt,lt,eq ,it will be always BT.
    and also when you see normal report program,you can use multiple values in either low or high,but here it is not possibel.
    use can enter only low value and high value.
    when you come to program point of view
    declare one range
    ranges r_kunnr for kna1-kunnr.
    do the coding like
    r_kunnr-low = v_kun_low.
    r_kunnr-high = v_kun_high.
    r_kunnr-options = 'BT'.
    r_kunnr-sign = 'I'.
    append r_kunnr.
    now you can use r_kunnr in select query ,it will work like select-option.
    other than this there is no option.
    Thanks
    Seshu

  • How can I pass environment variables to the child process?

    How can I pass environment variables to the child process? This is what I tried and it didn't work.
         static public void main (String[] args) throws Exception {
              ProcessBuilder b = new ProcessBuilder("java", "-cp", ".", "Child");
              Map<String, String> map = b.environment();
              map.put("custom.property", "my value");
                 b.redirectErrorStream(true);
              Process p = b.start();
              BufferedReader reader = new BufferedReader (new InputStreamReader(p.getInputStream()));
              String line = null;
              while (null != (line = reader.readLine())) {
                   System.out.println(line);
         public static void main(String[] args) {
              System.out.println("The value of custom.property is : " + System.getProperty("custom.property"));
         }and the result is:
    The value of custom.property is : null

    Complete test:
         static public void main (String[] args) throws Exception {
              ProcessBuilder b = new ProcessBuilder("java", "-Dcustom.property=my property value", "-cp", ".", "Child");
              Map<String, String> map = b.environment();
              map.put("custom.property", "my environment value");
                 b.redirectErrorStream(true);
              Process p = b.start();
              BufferedReader reader = new BufferedReader (new InputStreamReader(p.getInputStream()));
              String line = null;
              while (null != (line = reader.readLine())) {
                   System.out.println(line);
         public static void main(String[] args) {
              System.out.println("Property value of custom.property is : " + System.getProperty("custom.property"));
              System.out.println("Environment value of custom.property is : " + System.getenv("custom.property"));          
         }

  • HP4275A can not pass self test after running the labview program

    I am using Labview to control HP4275A LCR meter. The Labview program is just the instrument driver for the HP4275A, and it works great. Before running the program, the instrument can pass both Open and Short test perfectly. But after running the program, it can not pass self test, neither Open nor Short. I don't know why?? Is it relative to my Labview program??
    Thanks

    Thank you so much for your help. Yes, the instrument is in Local after running the instrument driver. In normal Open self test, just choose Capactiance as the Display A, and leave the four output terminals open then press the Self Test button. The Open self test will start and "OP" will be shown in the DIsplay A window, after 2 seconds, the open test will be finished. If something abnormal, the number of the abnormal step is displayed in Display A. Similar with the Short test.
    The problem I had was: before running the instrument driver, the self tests pass; but after running the instrument driver, the Open and Short test show abnormal, Open test is abnormal at step 17, and Short test is abnormal at step 24.
    And the instrument driver is only write commands into the instrument and then read back measuring values from it. Nothing else. So I am not sure if the problem is my instrument driver.
    The weird thing is the problems happened several times and then if I do the Open and Short self test again after running the instrument driver, both pass. I am not sure whether the problem will come back or not.
    Ia there any help??
    Big thanks

  • How can we pass the master report value in to detail  report

    Hi All,
    My question is how can I pass the master report value in to detail (Child) report filter?
    I mean I have one master report if I click on employee name then I have to pass the employee id in to details report filter. Then detail report will display data for that particular employee.
    How can I achieve this one in OBIEE?
    Please help me to resolve this issue. Thanks in advance for your time and support.

    In that case, you should look at using Go Url. In your column formula for the employee name, create a hyperlink to the detail report and pass the employee id.
    Take a look at this post: Re: Dyanmic display of the Image Link URL
    Thanks!

  • How can i pass a variable instead of a table name in the Select statement.

    Dear all
    how can i pass a variable instead of a table name in a select statement ?
    Example :-
    Begin
    P_get_procedure_tname (aap_name,otable_name);--It will take an application name and will return a table name
    Select col1 into ocol1
    from  ---- here i want to pass the variable OTABLE_NAME
    End;How can i pass this ?

    Hi,
    You can use dynamic sql.
    EXECUTE IMMEDIATE 'SELECT COL1 INTO ' || OCOL1 || ' FROM " || OTABLE_NAME;
    {code}
    cheers
    VT                                                                                                                                                                                                                                                                                                   

  • I have € 0.09 in my account and I can not buy anything with this value. I want to undo (give up) this value. What do I do?

    I have € 0.09 in my account and I can not buy anything with this value. I want to undo (give up) this value. What do I do?

    Click here and request assistance.
    (68968)

  • HT204406 my iTunes match can not pass the step 2, it keeps repeat again and again. Pls advise. Thank you.

    my iTunes Match can not pass the step 2, it keeps repeat again and again. Pls advise. Thank you.

    Very strange.  Two items to try:
    a.  Enable iCloud Status and iCloud Download fields in Song view, sort on status and look for any 'waiting' or 'error';
    b.  If (a) looks good, establish a new user account, create an empty library and enable iTunes Match, confirm that this provides access to all Songs and is working well.
    These are seeking to ensure both no bad Songs or local Library corruption - both are relatively quick.

  • I can not pass the language settings menu

    Hello,
    Since I have tried to get the latest build of Apple TV, my apple TV can not pass the language settings menu. I choose my language and then it loops back to language settings menu.
    I have restored twice from iTunes, plug and unplug from the tv, the electric network, and so on, but it does the same loop.
    Anybody has solved this problem ?
    Regards,
    F

    If you can't get past the lock screen when you slide to unlock, try rebooting your iPad and then try again.
    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up.

  • I can not pass the lock screen

    I can not pass the lock screen, when I slide to unlock

    If you can't get past the lock screen when you slide to unlock, try rebooting your iPad and then try again.
    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up.

  • Can not set OARG.cstAllcAcc field value with CustomsGroups Object

    Can not set OARG.cstAllcAcc field value with CustomsGroups Object, please open this field in this Object because it is a key field related to financial system.

    I guess, it should work; instead of html:submit, try with button.

  • GRE traffic can not pass through LRT224 IPSec Tunnel

    Hi,
    We have a trouble when using Cisco Router GRE tunnel plus LRT224 IPSec Gateway-Gateway Tunnel.
    We found after reboot, GRE packets can not pass trough LRT224 IPSec tunnel. need to restart serval time then gre will back to normal.
    Besides that, GRE keepalive packets can not pass trough LRT224 IPSec Tunnel.
    please help. I had tried to upgrade to latest firmware version.
    Firmware Version : v1.0.3.09 (Dec 26 2014 14:28:46) 
    A-END:
    interface Tunnel1
    ip address 10.216.80.105 255.255.255.252
    ip mtu 1400
    ip nat outside
    ip virtual-reassembly in
    ip tcp adjust-mss 1360
    ip ospf network point-to-point
    ip ospf hello-interval 3
    ip ospf cost 10000
    tunnel source 10.216.81.2
    tunnel destination 10.216.80.90
    end
    B-END:
    interface Tunnel11
    ip address 10.216.80.110 255.255.255.252
    ip mtu 1400
    ip tcp adjust-mss 1360
    ip ospf network point-to-point
    ip ospf cost 10000
    ip ospf hello-interval 3
    tunnel source 10.216.80.91
    tunnel destination 10.216.81.3
    end
    CISCO2911 <> LRT224 <> INTERNET <> LRT224 <> CISCO 2621
    San

    Can you post the results from the below command for the Cisco Routers?
    IOS Command: "sh version"
    Why not static route without NAT through the LRT224 IPSec VPN?
    Just curious why did you use LRT224's for the Site to Site VPN instead of the Cisco Routers?
    Please remember to Kudo those that help you.
    Linksys
    Communities Technical Support

  • I am on a i mac osx 10.8.4 and can not get into i photo i keep recieving the message "The library could not be opened because the file system of the library's volume is unsupported.

    I am on a i mac osx 10.8.4 and can not get into i photo i keep recieving the message "The library could not be opened because the file system of the library's volume is unsupported."

    Where is the Library? It needs to be on a disk formatted Mac OS Extended (Journaled)

Maybe you are looking for

  • Spry Data needs to popluate 2 widgets on the fly

    I have thrown together two spry widgets that should populate with XML data based on what is selected from a form control. -Based on what is selected from the from control, the tabbed menu should update it's tabs and content. -In the tabbed menu conte

  • Video Streaming from Server

    My configuration at school: 20 iPads connected by Wifi to Server ( Mac Mini Server ML ) So i can upload and download iWork-Documents via WebDav. This document pool works fine My next idea is to set up a media pool. I download a lot of relevant videos

  • Flash client not cleaning up socket connections

    I have an embedded flex application which recieves asyncronous data updates from a Blaze DS server on Tomcat that is using spring integration. I'm currently using a single, unsecure channel just to make things simple. My problem is that I'm periodica

  • Error in background processing

    Hi all, I am geting this error in back ground job as "ABAP/4     processor: SPOOL_I/O_ERROR".   can anyone help.   Regards,   Tarang

  • Vector files in Edge Reflow...

    Not working as native imports... Both copying & pasting or import not working as .AI or .EPS Is it because I'm using Illustrator CS6 vs Reflow CC? The only way it imports is if I save it as an .SVG Not a problem, just wondering because I was under th