Loading Struct from dll

This is a discussion on Loading Struct from dll within the C++ Programming forums, part of the General Programming Boards category; Hi all, I am writting a code with MSVC++ and I want to use a dll file in my C++ ...

  1. #1
    Registered User
    Join Date
    Jul 2008
    Posts
    7

    Loading Struct from dll

    Hi all,

    I am writting a code with MSVC++ and I want to use a dll file in my C++ program.
    I have to load a function from dll file whose return type is a pointer to a struct that has been defined in that dll and I need to access that struct during my program.
    I guess there should be a way to load a struct from dll file as well (something like GetProcAddress for loading functions). Can anybody help me with the way to load struct into my program?

    any help is greatly appreciated,
    Peyman

  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    23,012
    A struct declaration should be available in a header file that ships with the dll, because unlike functions, at machine level, structs do not exist, so you need that declaration of how it looks like.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #3
    Registered User
    Join Date
    Jul 2008
    Posts
    7
    Thanks for your help.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Loading a DLL that is not in the same directory as the executable
    By starcatcher in forum Windows Programming
    Replies: 10
    Last Post: 12-13-2008, 07:05 AM
  2. Replies: 1
    Last Post: 12-03-2008, 03:10 AM
  3. Looking for constructive criticism
    By wd_kendrick in forum C Programming
    Replies: 16
    Last Post: 05-28-2008, 10:42 AM
  4. Global Variables
    By Taka in forum C Programming
    Replies: 34
    Last Post: 11-02-2007, 04:25 AM
  5. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 07:39 AM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21