dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: Urgent: DLL

  1. #1
    Join Date
    May 2015
    Posts
    187

    Urgent: DLL

    I am told to write a DLL. I am told the client will give me the .h file like this, where they define the function:

    dll.h
    Code:
    extern "C"
    {
    
    	// Sets 'modelList' to a newline-separated ('\n') list of available propagation models.
    	// The last name is followed by a '\n' separator too.
    	__declspec(dllexport) void GetAvailablePropagationModels(BSTR* modelList);
    
    	// Returns a pointer to a new instance of the specified propagation model. Needs to initialize the new model using initData.
    	// Returns nullptr in case of error and then sets errorMessage.
    	// Returns nullptr if the given initData.version is not supported.
    	__declspec(dllexport) velox::propagation_api::IPropagationModel* GetPropagationModel(const wchar_t* name, 
            velox::propagation_api::StaticData* initData, BSTR* errorMessage);
    }
    I am told to implement these in my new DLL. It is confusing. i am new to windows programming. Usually if i write the DLL, i need to give the a header to the client with the above info.
    Here i am told that they define the function, i need to implement it.
    Please help me understand. It is quite urgent

  2. #2
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    6,867

    Re: Urgent: DLL

    Please help me understand
    Understand what? You have previously written dll's so you know their source structure etc. Here you have to write 2 function definitions given the above function declarations. Assuming you are familiar with velox etc, then the functions just need to do what the comments describe.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++17 Compiler: Microsoft VS2019 (16.3.4)

  3. #3
    Join Date
    May 2015
    Posts
    187

    Re: Urgent: DLL

    Thanks a lot kaud .
    Usually, from my basic understanding, it is the person who writes the dll, gives the .h. Here i was told to use the one given by the client and implement the functions in it.
    I just needed some input from the c++ windows experts that what i understand is correct
    Last edited by pdk5; October 8th, 2019 at 04:44 AM.

  4. #4
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,545

    Re: Urgent: DLL

    Why does it matter who writes the header files? Just implement the function bodies in a DLL.

  5. #5
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,100

    Re: Urgent: DLL

    Using C++? It may make a difference if the dll is written using a different compiler than the version used to compile the client.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)