Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21990

accessing to simple structure from vb6

$
0
0
Hello Everybody,
i am new in programming at all.
i am trying all the day to figure out how to get with simple structure and access and change the values in it with vb6.

I have found at least this :

// dllhdr.h: The interface of the DLL.
#ifndef GUARD_DLLHDR_H
#define GUARD_DLLHDR_H

#if defined(BUILD_MY_DLL)
#define DLLSYM __declspec(dllexport)
#else
#define DLLSYM __declspec(dllimport)
#endif

#if defined(__cplusplus)
extern "C" {
#endif

struct MyData
{
/* Put data here. */
};

DLLSYM extern MyData myData;

#if defined(__cplusplus)
}
#endif

#endif /*guard*/

--------------------------------------
// dllimp.cpp: DLL implementation file
#define BUILD_MY_DLL
#include "dllhdr.h"
MyData myData;

------------------------------------

i have created the dll above

then i have only changed the structure to this


struct MyData
{
unsigned int z1 :1
unsigned int z2 :1
unsigned int z3 :1
}


now from my vb6 programm i need to change the values in those variables z1, z2 and z3 to the values 0 or 1 in simpliest way


i have tried this
Declare Function MyData Lib "c:\firstdll\dllimp.dll" -no errors

now when i try to dim Mybits(20) as MyData ----it says user typ not defined



can someone please help?
sorry if my english is bad :)

Viewing all articles
Browse latest Browse all 21990

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>