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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  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.
  • 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