07-21-2011 04:04 AM
Hi
I got a problem which is not making sense.
I got a program which takes a bin file which is a program and downloads it via the parallel port to a device to simulator the program.
The problem is that my program doesnt download vai the parallel port correctly if i acces the registry.
Why could this be ?
if i comment those registry functions it downloads correctly.
I get the correct information from the registry functions and no errors.
Here is an example for my registry functions:
HKEY hKey;
LONG openres;
DWORD res;
DWORD type =REG_SZ;
DWORD cbData =1024;
openres=RegOpenKeyEx(HKEY_CURRENT_USER,"SOFTWARE\\Winzapper\\General",0,KEY_QUERY_VALUE,&hKey);
if(openres!=ERROR_SUCCESS)
{
MessagePopup("","Error Opening Registry Key");
}
else
{
res=RegQueryValueEx(hKey,"EpromTypeIndex", NULL, &type, buffer, &cbData);
if(res!=ERROR_SUCCESS)
{
MessagePopup("","Error reading value");
}
else
{
Config.iEpromType=atoi(buffer);
SetCtrlIndex (MainPnl, MAINPANEL_EPROM_TYPE, Config.iEpromType);
}
res=RegCloseKey(hKey);
if(res!=ERROR_SUCCESS)
{
MessagePopup("","Error closing registry key");
}
}
07-22-2011 03:19 PM
Hi Shako,
Could you provide us with your code that pushes the bin file also?
Regards,
Josh L.
07-25-2011 01:21 AM
I found my the problem.
I was sending some incorrect information and by commenting out the registry functions set the program to my default values which were correct.
The actual registry functions were not a problem.