I am using the following statement to load a dll in my code
HINSTANCE hDLL = LoadLibrary(LibName);
The library is being loaded and works as expected. My questions are
1. What will happen if...
Type: Posts; User: pk68
I am using the following statement to load a dll in my code
HINSTANCE hDLL = LoadLibrary(LibName);
The library is being loaded and works as expected. My questions are
1. What will happen if...
The problem is I don't know the members. All I know are the number of members and their data types and the datatypes are mixed within the structure.
I am sorry, I don't understand this. Is there a way to access the address of structure members so that I can use memcpy to update them.
Hello Bayint,
I am writing a C program to load a library(dll) and update certain values in the dll. I don’t have the source code of the dll. However the dll provides me the Structure, number of...
I am trying to update the members of a structure using memcpy and running into issues determining the indexes of the elements. here is an example
struct AA{
double a;
double b;
double...
Hi Whiteflags,
Thanks for your continued help. One of the things I noticed while reading more about vectors is the resize method. I have modified to use resize to increase the structure arrays...
My bad. I had to create an instance of AA. So I declared
AA test;
and then added the line
load.push_back(test);
Is this the correct way to code it. Now if I want to assign values to the...
That's what I thought. But it results in the following error
load.push_back(AA);
test.cxx(139) : error C2275: 'AA' : illegal use of this type as an expression
test.cxx(18) : see...
Thanks whiteflags. vector<AA>load(5) is the correct declaration. I fixed those errors and don't get the crash anymore. Now I want to increment the number of structures based on user input and not...
OK. I converted my function to use vectors. Following is how I changed the function
struct AA
{
vector<int>grid_id;
vector<double>lv_x;
vector<double>lv_y;
vector<double>lv_z;
I couldn't get vectors to work. I was running into following messages which I didn't understand. If someone can provide the syntax, I am more than willing to switch to vectors
LINK : test.dll not...
I need some help assigning memory to hold an array of structures with variable member arrays. Here is a part of the code
typedef struct
{
double *t_stp;
int *grid_id;
double...
I would appreciate if someone can provide the syntax to allocate memory to the structure and the structure members dynamically. I am new to C programming and struggling a little to get this going....
It needs to be
data[0].a = malloc(sizeof(double) * 10);
data[0].b = malloc(sizeof(double) * 20);
data[1].a = malloc(sizeof(double) * 20);
data[1].b = malloc(sizeof(double) * 40);
....
....
All,
I need some help creating an array of structure whose memory is allocated at run time. Also the structure has members whose size are different and again memory is allocated at run time. For...