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
- :
- FlexNet Publisher
- :
- FlexNet Publisher Forum
- :
- System.AccessViolationException on Windows 7
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
Jan 14, 2010
02:27 PM
System.AccessViolationException on Windows 7
After I checked out the license for the feature/version, then processed both code1 and code2 on Windows XP. Both of them worked fine on Windows XP. But The code1 threw an AccessViolationException on Windows 7.
(Attempted to read or write protected memory. This is often an indication that other memory is corrupt) Do you have any ideas on this?
code1
CONFIG *conf = NULL;
conf = lc_auth_data(lm_job, FeatureName);
char *vendorString = conf->lc_vendor_def;
code2
CONFIG *conf = NULL;
conf = lc_auth_data(lm_job, FeatureName);
long days = lc_expire_days(lm_job, conf);
Thanks,
(Attempted to read or write protected memory. This is often an indication that other memory is corrupt) Do you have any ideas on this?
code1
CONFIG *conf = NULL;
conf = lc_auth_data(lm_job, FeatureName);
char *vendorString = conf->lc_vendor_def;
code2
CONFIG *conf = NULL;
conf = lc_auth_data(lm_job, FeatureName);
long days = lc_expire_days(lm_job, conf);
Thanks,
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Jan 18, 2010
10:05 AM
My demo application is a C# windows appliation, and it calls c++ functions to
get the data. Both demo1 and demo2 works fine on Windows xp, but the demo2 crashes on Windows 7 by throwing an error (System.AccessViolationException).
As you can see the function "demo1",
using conf->lc_vendor_def do not crash on Windows 7, but it just crashes when
I return the "conf->lc_vendor_def". Any suggestions to make it work on Windows 7?
C#
[DllImport("demo.dll", CharSet = CharSet.Ansi)]
public static extern string demo1();
[DllImport("demo.dll", CharSet = CharSet.Ansi)]
public static extern string demo2();
C++
char* demo1()
{
initialize the job...
Checkout the license...
...
...
CONFIG *conf = NULL;
conf = lc_auth_data(lm_job, FeatureName);
char* vendorString = conf->lc_vendor_def;
char* test = "LM_CHAR_PTR";
return test;
}
char* demo2()
{
initialize the job...
Checkout the license...
...
...
CONFIG *conf = NULL;
conf = lc_auth_data(lm_job, FeatureName);
char* vendorString = conf->lc_vendor_def;
return vendorString;
}
get the data. Both demo1 and demo2 works fine on Windows xp, but the demo2 crashes on Windows 7 by throwing an error (System.AccessViolationException).
As you can see the function "demo1",
using conf->lc_vendor_def do not crash on Windows 7, but it just crashes when
I return the "conf->lc_vendor_def". Any suggestions to make it work on Windows 7?
C#
[DllImport("demo.dll", CharSet = CharSet.Ansi)]
public static extern string demo1();
[DllImport("demo.dll", CharSet = CharSet.Ansi)]
public static extern string demo2();
C++
char* demo1()
{
initialize the job...
Checkout the license...
...
...
CONFIG *conf = NULL;
conf = lc_auth_data(lm_job, FeatureName);
char* vendorString = conf->lc_vendor_def;
char* test = "LM_CHAR_PTR";
return test;
}
char* demo2()
{
initialize the job...
Checkout the license...
...
...
CONFIG *conf = NULL;
conf = lc_auth_data(lm_job, FeatureName);
char* vendorString = conf->lc_vendor_def;
return vendorString;
}