This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Pointer to an array inside a structure
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Aug 27, 2008
07:35 AM
Pointer to an array inside a structure
Hi!
I'm trying to make a pointer to an array in order to initialize the structures contained within, but
I keep obtaining a mismatch error 0x80020005.
The array is contained in another struct.
Here is the code:
Could somebody help me?
Thanks in advance!
I'm trying to make a pointer to an array in order to initialize the structures contained within, but
I keep obtaining a mismatch error 0x80020005.
The array is contained in another struct.
Here is the code:
// Constants
#define MAX_PARAMS 10
// Types
typedef COMMANDLINEPARAM_TYPE
begin
STRING original(MAX_PATH);
STRING name(MAX_PATH);
STRING value(MAX_PATH);
end;
typedef COMMANDLINE_TYPE
begin
STRING full_path(MAX_PATH*2); // Executable "C:\Gerbo\Virus.exe" (no quotes included)
COMMANDLINEPARAM_TYPE params(MAX_PARAMS); // Parameters
NUMBER num_params; // Number of parameters filled
end;
// Prototypes
export prototype object CommandLine_Decompose(STRING);
prototype object _NewCommandLineParam();
// Functions
///**
//* Reads a command line like in desktop shortcuts and separates it in file
//* and parameters
//* @param szCommandLine The command line as taken from the desktop icon
//* @return the object that describes the command line(COMMANDLINE_TYPE) or null if fails.
//*/
function object CommandLine_Decompose(szCommandLine)
COMMANDLINE_TYPE comm_line_result; // The struct to be returned
COMMANDLINEPARAM_TYPE param;
COMMANDLINEPARAM_TYPE POINTER pParam;
LIST listCommand; // command and parameters
STRING svCurrentElement; // Temporary string
NUMBER nLoop; // Variable for iteration
LIST listParam; // Param and value
NUMBER nParamLoop; // Loop for listParam
NUMBER i;
begin
pParam = comm_line_result.params;
for i = 0 to (MAX_PARAMS - 1)
set param = _NewCommandLineParam();
pParam = ¶m;
pParam++;
endfor;
comm_line_result.num_params = 0;
...
end;
///**
//* Creates a struct of COMMANDLINEPARAM_TYPE
//* @return struct of COMMANDLINEPARAM_TYPE
//*/
function object _NewCommandLineParam()
COMMANDLINEPARAM_TYPE p;
begin
return p;
end;
Could somebody help me?
Thanks in advance!
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Oct 09, 2008
12:46 AM
I also had this problem.
Anybody can help us/:confused:
Anybody can help us/:confused:
![](/skins/images/CC38E504FC9E1309DC48ACFEB4925670/responsive_peak/images/icon_anonymous_message.png)