function inside structure 
Author Message
 function inside structure

Hi,

I'm close to find solution for my unace problem.
As you can remember my UNACE.H file is like that :
----------

struct ACEOpenArchiveData
{
   char *ArcName;
   UINT OpenMode;
   UINT OpenResult;
   UINT Flags;
   UINT Host;
   char AV[51];
   char *CmtBuf;
   UINT CmtBufSize;
   UINT CmtSize;
   UINT CmtState;
   int Pascal (*ChangeVolProc)(char *ArcName,int Mode);
   int PASCAL (*ProcessDataProc)(unsigned char *Addr,int Size);

Quote:
};

#pragma pack()

HANDLE __stdcall _ACEOpenArchive(struct ACEOpenArchiveData *ArchiveData);
int __stdcall ACECloseArchive(HANDLE hArcData);
int __stdcall ACEReadHeader(HANDLE hArcData,struct ACEHeaderData
*HeaderData);
int __stdcall ACEProcessFile(HANDLE hArcData,int Operation,char *DestPath);
int __stdcall ACESetPassword(HANDLE hArcData,char *Password);

typedef HANDLE (__stdcall *PROCUnAceOpenArchive)(ACEOpenArchiveData*);
typedef int (__stdcall *PROCUnAceCloseArchive)(HANDLE);
typedef int (__stdcall *PROCUnAceReadHeader)(HANDLE, ACEHeaderData*);
typedef int (__stdcall *PROCUnAceProcessFile)(HANDLE, int, char*);
typedef int (__stdcall *PROCUnAceSetPassword)(HANDLE, char*);
--------
in my *.c, i've created a function
int PASCAL ChangeVolume(char *ArcName, int Mode);
which i want to use to retrieve the name of my archive file and the mode...
during my initialization i wrote :

char *test;
struct ACEOpenArchiveData OpenArchiveData;
OpenArchiveData.ArcName=ArcName;
OpenArchiveData.CmtBuf=CmtBuf;
OpenArchiveData.CmtBufSize=sizeof(CmtBuf);
OpenArchiveData.ChangeVolProc=&ChangeVolume;
OpenArchiveData.ProcessDataProc=&Decompression;
hArcData=_AceOpenArchive(&OpenArchiveData);
....

so normally with the following function, i should have my data :
int PASCAL ChangeVolume(char *ArcName, int Mode)
{
    MessageBox(Handle,ArcName,"Next Volume Name",MB_OK); // it doesn't work
    MessageBox(Handle,(LPCTSTR)Mode,"Mode is ...",MB_OK); // it works great
    return(1);

Quote:
}

-----
but in fact, i just have Mode value....ArcName is everytime a random
value like NULL or empty value...
the same trouble with :
int PASCAL (*ProcessDataProc)(unsigned char *Addr,int Size);

Quote:
};

it seems that char* as some trouble to retrieve my value... Why ?

TIA,
Al.



Mon, 11 Apr 2005 20:48:57 GMT  
 function inside structure

Quote:
> I'm close to find solution for my unace problem.
> As you can remember my UNACE.H file is like that :

    Well, actually, I don't, since the only previous message I can find from
you on this newsgroup is from three months ago, and on a different subject.

Quote:
> but in fact, i just have Mode value....ArcName is everytime a random
> value like NULL or empty value...

    What you've posted looks fine.  We'll need to see how you get from
AceOpenArchive() to ChangeVolume() and where the value you put into
OpenArchiveData come from.

--
Truth,
James Curran
www.NovelTheory.com  (Personal)
www.NJTheater.com   (Professional)
www.aurora-inc.com   (Day job)



Mon, 11 Apr 2005 22:34:02 GMT  
 function inside structure
Well, i use GetProcAddress to get handles of AceOpenArchive function..
But everything works great till i called ACEProcessFile function...here
is my trouble i think
Al.
Quote:
>     What you've posted looks fine.  We'll need to see how you get from
> AceOpenArchive() to ChangeVolume() and where the value you put into
> OpenArchiveData come from.



Tue, 12 Apr 2005 16:12:43 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. newbie, loosing structure data inside a function

2. Referring to structure member inside structure

3. declaring functions inside other functions

4. Setting a pointer to a function, inside a function

5. Function inside another function?...

6. printing function name and arguments from inside a function

7. function to be defined inside other function

8. Function pointer to function inside class

9. Structure, where is one array inside the struct...

10. Nested linked list inside structure the sequal

11. Nesting linked list inside a structure

12. casting a pointer to an structure to an strcuture inside the first

 

 
Powered by phpBB® Forum Software