Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Call to Library Data all Zeros 1

Status
Not open for further replies.

sweep123

Technical User
Joined
May 1, 2003
Messages
185
Location
GB
I have created a static library and have passed over a data structure, but when I look at this structure following the call it contains all zeros.

Can someone tell me what I am doing wrong.

In the callng program:

static STATUSINFO status_data; // The data structrue


I now call the library finction GetStatusInfo with this data structure as follows:

GetStatusInfo(&status_data);

The library function goes like this:

UINT16 GetStatusInfo(STATUSINFO * Status_Info_Data)
{

STATUSINFO Status_Info;

Status_Info.item; / set the items
...

...

// Now set the return structure to the one just filled
Status_Info_Data = &status_Info;
return API_OK;

}

The data structute is populated correctly in the library call GetStartInfo (checked via breakpoint), but not
when I look that the data following the call to GetStatusInfo in my program.
 
how about:

UINT16 GetStatusInfo(STATUSINFO * Status_Info_Data)
{

Status_Info->item ...; / set the items
...

or

UINT16 GetStatusInfo(STATUSINFO * Status_Info_Data)
{

STATUSINFO Status_Info;

Status_Info.item ...; / set the items
...
// Now set the return structure to the one just filled
*Status_Info_Data = status_Info;

return API_OK;

}

Ion Filipski
1c.bmp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top