Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. DLL creation process in windows application with CEN XFS

DLL creation process in windows application with CEN XFS

Scheduled Pinned Locked Moved C / C++ / MFC
sharepointcomhelp
17 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V venkat swaminathan

    So, you suspect this might the issue with SP code which i am currently working with??.

    Richard Andrew x64R Offline
    Richard Andrew x64R Offline
    Richard Andrew x64
    wrote on last edited by
    #4

    Well, since that is not a Windows error message, I can only assume it is specific to the library you are using.

    The difficult we do right away... ...the impossible takes slightly longer.

    1 Reply Last reply
    0
    • Richard Andrew x64R Richard Andrew x64

      I googled the error message you mention and could not find it in the Windows API. It doesn't look like a Windows error message. I'm afraid the maker of the device might be the only one who could help you with this problem. EDIT: Perhaps this is a call stack corruption caused by removing the WINAPI definition. WINAPI simply means __stdcall which is the calling convention used by the Windows API.

      The difficult we do right away... ...the impossible takes slightly longer.

      V Offline
      V Offline
      venkat swaminathan
      wrote on last edited by
      #5

      Also i see some difference in Sp's DLL which i created and actual working vendors DLL
      Difference noted using PE studio's exported sysmbols option
      DLL Created by ME:

      _WFPCancelAsyncRequest@8,-,1,-,-,.rdata:0x00001096
      _WFPClose@12,-,2,-,-,.rdata:0x00001005
      _WFPDeregister@20,-,3,-,-,.rdata:0x00001140
      _WFPExecute@24,-,4,-,-,.rdata:0x00001131
      _WFPGetInfo@24,-,5,-,-,.rdata:0x000010EB
      _WFPLock@16,-,6,-,-,.rdata:0x00001023
      _WFPOpen@52,-,7,-,-,.rdata:0x0000102D
      _WFPRegister@20,-,8,-,-,.rdata:0x00001073
      _WFPSetTraceLevel@8,-,9,-,-,.rdata:0x0000113B
      _WFPUnloadService@0,-,10,-,-,.rdata:0x0000100A
      _WFPUnlock@12,-,11,-,-,.rdata:0x00001082

      Vendor created DLL:

      WFPCancelAsyncRequest,-,1,-,-,.rdata:0x0000C450
      WFPClose,-,2,-,-,.rdata:0x0000C6E0
      WFPDeregister,-,3,-,-,.rdata:0x0000C7F0
      WFPExecute,-,4,-,-,.rdata:0x0000C970
      WFPGetInfo,-,5,-,-,.rdata:0x0000DFA0
      WFPLock,-,6,-,-,.rdata:0x0000E490
      WFPOpen,-,7,-,-,.rdata:0x0000C030
      WFPRegister,-,8,-,-,.rdata:0x0000E590
      WFPSetTraceLevel,-,9,-,-,.rdata:0x0000E710
      WFPUnloadService,-,10,-,-,.rdata:0x0000E770
      WFPUnlock,-,11,-,-,.rdata:0x0000E8F0

      What is the difference.Does export method differ??

      Richard Andrew x64R 1 Reply Last reply
      0
      • V venkat swaminathan

        Also i see some difference in Sp's DLL which i created and actual working vendors DLL
        Difference noted using PE studio's exported sysmbols option
        DLL Created by ME:

        _WFPCancelAsyncRequest@8,-,1,-,-,.rdata:0x00001096
        _WFPClose@12,-,2,-,-,.rdata:0x00001005
        _WFPDeregister@20,-,3,-,-,.rdata:0x00001140
        _WFPExecute@24,-,4,-,-,.rdata:0x00001131
        _WFPGetInfo@24,-,5,-,-,.rdata:0x000010EB
        _WFPLock@16,-,6,-,-,.rdata:0x00001023
        _WFPOpen@52,-,7,-,-,.rdata:0x0000102D
        _WFPRegister@20,-,8,-,-,.rdata:0x00001073
        _WFPSetTraceLevel@8,-,9,-,-,.rdata:0x0000113B
        _WFPUnloadService@0,-,10,-,-,.rdata:0x0000100A
        _WFPUnlock@12,-,11,-,-,.rdata:0x00001082

        Vendor created DLL:

        WFPCancelAsyncRequest,-,1,-,-,.rdata:0x0000C450
        WFPClose,-,2,-,-,.rdata:0x0000C6E0
        WFPDeregister,-,3,-,-,.rdata:0x0000C7F0
        WFPExecute,-,4,-,-,.rdata:0x0000C970
        WFPGetInfo,-,5,-,-,.rdata:0x0000DFA0
        WFPLock,-,6,-,-,.rdata:0x0000E490
        WFPOpen,-,7,-,-,.rdata:0x0000C030
        WFPRegister,-,8,-,-,.rdata:0x0000E590
        WFPSetTraceLevel,-,9,-,-,.rdata:0x0000E710
        WFPUnloadService,-,10,-,-,.rdata:0x0000E770
        WFPUnlock,-,11,-,-,.rdata:0x0000E8F0

        What is the difference.Does export method differ??

        Richard Andrew x64R Offline
        Richard Andrew x64R Offline
        Richard Andrew x64
        wrote on last edited by
        #6

        You've hit the nail on the head! The ones on the bottom are exported like so:

        extern "C"
        {
        // Functions
        }

        The ones on the top are exported in C++ fashion, with name mangling. Try exporting your functions as extern "C" .

        The difficult we do right away... ...the impossible takes slightly longer.

        V 1 Reply Last reply
        0
        • Richard Andrew x64R Richard Andrew x64

          You've hit the nail on the head! The ones on the bottom are exported like so:

          extern "C"
          {
          // Functions
          }

          The ones on the top are exported in C++ fashion, with name mangling. Try exporting your functions as extern "C" .

          The difficult we do right away... ...the impossible takes slightly longer.

          V Offline
          V Offline
          venkat swaminathan
          wrote on last edited by
          #7

          Thanks your tip help me to start some invetigation.All these days we were with LINUX. Migrating to windows seems little difficult for me. Where should :

          extern "C"
          {

          }

          </pre>

          be added??

          Because SPITesh.H, the code has the expected tag...

          #ifdef __cplusplus
          extern "C" {
          #endif
          SPITEST_API HRESULT WINAPI WFPCancelAsyncRequest(HSERVICE hService, REQUESTID RequestID);
          SPITEST_API HRESULT WINAPI WFPClose(HSERVICE hService, HWND hWnd, REQUESTID ReqID);
          SPITEST_API HRESULT WINAPI WFPDeregister(HSERVICE hService, DWORD dwEventClass, HWND hWndReg, HWND hWnd, REQUESTID ReqID);
          SPITEST_API HRESULT WINAPI WFPExecute(HSERVICE hService, DWORD dwCommand, LPVOID lpCmdData, DWORD dwTimeOut, HWND hWnd, REQUESTID ReqID);
          SPITEST_API HRESULT WINAPI WFPGetInfo(HSERVICE hService, DWORD dwCategory, LPVOID lpQueryDetails, DWORD dwTimeOut, HWND hWnd, REQUESTID ReqID);
          SPITEST_API HRESULT WINAPI WFPLock(HSERVICE hService, DWORD dwTimeOut, HWND hWnd, REQUESTID ReqID);
          SPITEST_API HRESULT WINAPI WFPOpen(HSERVICE hService, LPSTR lpszLogicalName, HAPP hApp, LPSTR lpszAppID, DWORD dwTraceLevel, DWORD dwTimeOut, HWND hWnd, REQUESTID ReqID, HPROVIDER hProvider, DWORD dwSPIVersionsRequired, LPWFSVERSION lpSPIVersion, DWORD dwSrvcVersionsRequired, LPWFSVERSION lpSrvcVersion);
          SPITEST_API HRESULT WINAPI WFPRegister(HSERVICE hService, DWORD dwEventClass, HWND hWndReg, HWND hWnd, REQUESTID ReqID);
          SPITEST_API HRESULT WINAPI WFPSetTraceLevel(HSERVICE hService, DWORD dwTraceLevel);
          SPITEST_API HRESULT WINAPI WFPUnloadService();
          SPITEST_API HRESULT WINAPI WFPUnlock(HSERVICE hService, HWND hWnd, REQUESTID ReqID);
          #ifdef __cplusplus
          };
          #endif

          Richard Andrew x64R 1 Reply Last reply
          0
          • V venkat swaminathan

            Thanks your tip help me to start some invetigation.All these days we were with LINUX. Migrating to windows seems little difficult for me. Where should :

            extern "C"
            {

            }

            </pre>

            be added??

            Because SPITesh.H, the code has the expected tag...

            #ifdef __cplusplus
            extern "C" {
            #endif
            SPITEST_API HRESULT WINAPI WFPCancelAsyncRequest(HSERVICE hService, REQUESTID RequestID);
            SPITEST_API HRESULT WINAPI WFPClose(HSERVICE hService, HWND hWnd, REQUESTID ReqID);
            SPITEST_API HRESULT WINAPI WFPDeregister(HSERVICE hService, DWORD dwEventClass, HWND hWndReg, HWND hWnd, REQUESTID ReqID);
            SPITEST_API HRESULT WINAPI WFPExecute(HSERVICE hService, DWORD dwCommand, LPVOID lpCmdData, DWORD dwTimeOut, HWND hWnd, REQUESTID ReqID);
            SPITEST_API HRESULT WINAPI WFPGetInfo(HSERVICE hService, DWORD dwCategory, LPVOID lpQueryDetails, DWORD dwTimeOut, HWND hWnd, REQUESTID ReqID);
            SPITEST_API HRESULT WINAPI WFPLock(HSERVICE hService, DWORD dwTimeOut, HWND hWnd, REQUESTID ReqID);
            SPITEST_API HRESULT WINAPI WFPOpen(HSERVICE hService, LPSTR lpszLogicalName, HAPP hApp, LPSTR lpszAppID, DWORD dwTraceLevel, DWORD dwTimeOut, HWND hWnd, REQUESTID ReqID, HPROVIDER hProvider, DWORD dwSPIVersionsRequired, LPWFSVERSION lpSPIVersion, DWORD dwSrvcVersionsRequired, LPWFSVERSION lpSrvcVersion);
            SPITEST_API HRESULT WINAPI WFPRegister(HSERVICE hService, DWORD dwEventClass, HWND hWndReg, HWND hWnd, REQUESTID ReqID);
            SPITEST_API HRESULT WINAPI WFPSetTraceLevel(HSERVICE hService, DWORD dwTraceLevel);
            SPITEST_API HRESULT WINAPI WFPUnloadService();
            SPITEST_API HRESULT WINAPI WFPUnlock(HSERVICE hService, HWND hWnd, REQUESTID ReqID);
            #ifdef __cplusplus
            };
            #endif

            Richard Andrew x64R Offline
            Richard Andrew x64R Offline
            Richard Andrew x64
            wrote on last edited by
            #8

            What you show inside SPITesh.H is the correct placement. Is that your file or the original vendor's file? In Visual Studio, when you compile the code as C++, it should automatically define __cplusplus . If it doesn't, then it might be that your source file extension is ".c" when it should be ".cpp".

            The difficult we do right away... ...the impossible takes slightly longer.

            V 1 Reply Last reply
            0
            • Richard Andrew x64R Richard Andrew x64

              What you show inside SPITesh.H is the correct placement. Is that your file or the original vendor's file? In Visual Studio, when you compile the code as C++, it should automatically define __cplusplus . If it doesn't, then it might be that your source file extension is ".c" when it should be ".cpp".

              The difficult we do right away... ...the impossible takes slightly longer.

              V Offline
              V Offline
              venkat swaminathan
              wrote on last edited by
              #9

              Yes, I sm trying to follow the same. but still it is doing no good. https://drive.google.com/file/d/0B60pejPe6yiSejRGQ3JnLUl4dzA/view[^] The link contains the project ref files i made sure all files are CPP and Extern C just for the headers. What else should i look ifor?? is there some settings that i should set in VS 2010 Express

              Richard Andrew x64R 1 Reply Last reply
              0
              • V venkat swaminathan

                Yes, I sm trying to follow the same. but still it is doing no good. https://drive.google.com/file/d/0B60pejPe6yiSejRGQ3JnLUl4dzA/view[^] The link contains the project ref files i made sure all files are CPP and Extern C just for the headers. What else should i look ifor?? is there some settings that i should set in VS 2010 Express

                Richard Andrew x64R Offline
                Richard Andrew x64R Offline
                Richard Andrew x64
                wrote on last edited by
                #10

                Try placing the

                #ifdef __cplusplus
                extern "C" {
                #endif
                // Functions
                #ifdef __cplusplus
                };
                #endif

                in the CPP file also, surrounding the functions you want to export. I think that is the issue.

                The difficult we do right away... ...the impossible takes slightly longer.

                V 2 Replies Last reply
                0
                • Richard Andrew x64R Richard Andrew x64

                  Try placing the

                  #ifdef __cplusplus
                  extern "C" {
                  #endif
                  // Functions
                  #ifdef __cplusplus
                  };
                  #endif

                  in the CPP file also, surrounding the functions you want to export. I think that is the issue.

                  The difficult we do right away... ...the impossible takes slightly longer.

                  V Offline
                  V Offline
                  venkat swaminathan
                  wrote on last edited by
                  #11

                  NO luck still.... :(

                  Richard Andrew x64R 1 Reply Last reply
                  0
                  • Richard Andrew x64R Richard Andrew x64

                    Try placing the

                    #ifdef __cplusplus
                    extern "C" {
                    #endif
                    // Functions
                    #ifdef __cplusplus
                    };
                    #endif

                    in the CPP file also, surrounding the functions you want to export. I think that is the issue.

                    The difficult we do right away... ...the impossible takes slightly longer.

                    V Offline
                    V Offline
                    venkat swaminathan
                    wrote on last edited by
                    #12

                    If possible can you just try downloading the code and check with your MS VS version??

                    Richard Andrew x64R 1 Reply Last reply
                    0
                    • V venkat swaminathan

                      NO luck still.... :(

                      Richard Andrew x64R Offline
                      Richard Andrew x64R Offline
                      Richard Andrew x64
                      wrote on last edited by
                      #13

                      I'm sorry. Maybe someone else will have some better ideas. :sigh:

                      The difficult we do right away... ...the impossible takes slightly longer.

                      1 Reply Last reply
                      0
                      • V venkat swaminathan

                        If possible can you just try downloading the code and check with your MS VS version??

                        Richard Andrew x64R Offline
                        Richard Andrew x64R Offline
                        Richard Andrew x64
                        wrote on last edited by
                        #14

                        I did. It won't compile because of a number of undefined symbols in SpiTest.cpp.

                        Quote:

                        2 IntelliSense: cannot open source file "xfsconf.h" d:\Richard\Documents\Visual Studio 2013\Projects\spi_QuantumT_bcr\spi_QuantumT_bcr\SpiTest.cpp 7 1 spi_QuantumT_bcr 3 IntelliSense: identifier "WFMOpenKey" is undefined d:\Richard\Documents\Visual Studio 2013\Projects\spi_QuantumT_bcr\spi_QuantumT_bcr\SpiTest.cpp 150 13 spi_QuantumT_bcr 4 IntelliSense: identifier "WFS_CFG_MACHINE_XFS_ROOT" is undefined d:\Richard\Documents\Visual Studio 2013\Projects\spi_QuantumT_bcr\spi_QuantumT_bcr\SpiTest.cpp 150 24 spi_QuantumT_bcr 5 IntelliSense: identifier "WFMQueryValue" is undefined d:\Richard\Documents\Visual Studio 2013\Projects\spi_QuantumT_bcr\spi_QuantumT_bcr\SpiTest.cpp 154 8 spi_QuantumT_bcr 6 IntelliSense: identifier "WFMCloseKey" is undefined d:\Richard\Documents\Visual Studio 2013\Projects\spi_QuantumT_bcr\spi_QuantumT_bcr\SpiTest.cpp 161 2 spi_QuantumT_bcr

                        The difficult we do right away... ...the impossible takes slightly longer.

                        V 1 Reply Last reply
                        0
                        • Richard Andrew x64R Richard Andrew x64

                          I did. It won't compile because of a number of undefined symbols in SpiTest.cpp.

                          Quote:

                          2 IntelliSense: cannot open source file "xfsconf.h" d:\Richard\Documents\Visual Studio 2013\Projects\spi_QuantumT_bcr\spi_QuantumT_bcr\SpiTest.cpp 7 1 spi_QuantumT_bcr 3 IntelliSense: identifier "WFMOpenKey" is undefined d:\Richard\Documents\Visual Studio 2013\Projects\spi_QuantumT_bcr\spi_QuantumT_bcr\SpiTest.cpp 150 13 spi_QuantumT_bcr 4 IntelliSense: identifier "WFS_CFG_MACHINE_XFS_ROOT" is undefined d:\Richard\Documents\Visual Studio 2013\Projects\spi_QuantumT_bcr\spi_QuantumT_bcr\SpiTest.cpp 150 24 spi_QuantumT_bcr 5 IntelliSense: identifier "WFMQueryValue" is undefined d:\Richard\Documents\Visual Studio 2013\Projects\spi_QuantumT_bcr\spi_QuantumT_bcr\SpiTest.cpp 154 8 spi_QuantumT_bcr 6 IntelliSense: identifier "WFMCloseKey" is undefined d:\Richard\Documents\Visual Studio 2013\Projects\spi_QuantumT_bcr\spi_QuantumT_bcr\SpiTest.cpp 161 2 spi_QuantumT_bcr

                          The difficult we do right away... ...the impossible takes slightly longer.

                          V Offline
                          V Offline
                          venkat swaminathan
                          wrote on last edited by
                          #15

                          XFSMANAGER INSTALLER: ftp://ftp.cencenelec.eu/CEN/WhatWeDo/Fields/ICT/eBusiness/WS/XFS/CWA15748/XFS310SDKInstall.zip

                          That is the libray link.

                          Richard Andrew x64R 1 Reply Last reply
                          0
                          • V venkat swaminathan

                            XFSMANAGER INSTALLER: ftp://ftp.cencenelec.eu/CEN/WhatWeDo/Fields/ICT/eBusiness/WS/XFS/CWA15748/XFS310SDKInstall.zip

                            That is the libray link.

                            Richard Andrew x64R Offline
                            Richard Andrew x64R Offline
                            Richard Andrew x64
                            wrote on last edited by
                            #16

                            I'm sorry, I'm not going to install anything on my development machine. Take a look at this article: extern "C"[^]

                            The difficult we do right away... ...the impossible takes slightly longer.

                            V 1 Reply Last reply
                            0
                            • Richard Andrew x64R Richard Andrew x64

                              I'm sorry, I'm not going to install anything on my development machine. Take a look at this article: extern "C"[^]

                              The difficult we do right away... ...the impossible takes slightly longer.

                              V Offline
                              V Offline
                              venkat swaminathan
                              wrote on last edited by
                              #17

                              No problem , I will try some option too...

                              1 Reply Last reply
                              0
                              Reply
                              • Reply as topic
                              Log in to reply
                              • Oldest to Newest
                              • Newest to Oldest
                              • Most Votes


                              • Login

                              • Don't have an account? Register

                              • Login or register to search.
                              • First post
                                Last post
                              0
                              • Categories
                              • Recent
                              • Tags
                              • Popular
                              • World
                              • Users
                              • Groups