|
Uhm, I don't think the issue with the CHM is the same. This may more be a case of broken links. Try running it from another local drive and you may get the same error.
Regards,
Nish
|
|
|
|
|
I have a managed c++ program which gives the following error when run over the network:
'System.Security.Policy.PolicyException'. It then fails to run.
To check the problem I shared a folder on my local machine giving full access rights to everyone.
Then I mapped the same folder back to myself as drive z:.
If I ran the program through the folder directly: no problem.
If I ran the same program through drive z: fails with above error.
I tried running non managed programs through drive z: and they all seem to work.
Is this a lost cause, or is there anything I can do?
Thanks,
Ilan
|
|
|
|
|
|
Hello!
I like to build an array of CheckBoxes in C++ Builder to call it in a for-loop like this:
for (int i = 0; i<10; i++)
{
CheckBox[i]->Checked = false;
}
How can I do this in best way? How can I create the CheckBoxes on the formular and include it in .h-file?
|
|
|
|
|
|
Could you please give me some idea on the best C++ compiler available for an Windows XP Pro system? I'd like to do some simple tasks that might include graphics. Thank you.
|
|
|
|
|
|
You could try Visual C++ 2005 Express Edition.
Regards,
Nish
|
|
|
|
|
Hello,
Is it possible to implement callback from MC++ to Native C++ using polymorphism?
The intention is to hold the pointer to the derived class in baseclass pointer on Managed C++, later to call the virtual function on the base class pointer. Is this possible without using DLLImport?
Thank you & Best Regards, Renuka
|
|
|
|
|
You don't need P/Invoke, you need a mixed-mode app or DLL. Polymorphism works the same way irrespective of whether you call it from native code or mixed mode code.
Regards,
Nish
|
|
|
|
|
Hello,
Thank you for the clarification. I thought of trying this problem in baby steps as mentioned below:
(1) Have a singleton unmanaged class (say X), shared across managed C++ and native C++.
(Please note a big assumption here. I'm not sure whether this makes sense as the heaps of native and managed worlds are handled differently.
(2) Set Derived class instance in X's singleton instance. X stores this instance in a base class pointer.
(3) Call virtual method on this base class pointer for native client derived class implementation to get executed.
But I'm 100% doubtful about step-1. It is because the heaps of native and managed worlds are different.Is this correct? Is there any alternative way to share the instance of a class between native and managed boundaries using IJW? At least can I use GlobalAlloc() to allocate the bytes to share across managed and native worlds?
How does .NET runtime know when to allocate on managed heap and when to allocate on native heap? Does it decide based on the caller (client)?
Thank you & Best Regards
-- modified at 19:07 Thursday 19th January, 2006
|
|
|
|
|
Native objects are created on the C++ heap (when you use new ) and managed objects are created on the garbage collected CLR heap (when you use gcnew ). There's currently no confusion since you can use new only with native objects and gcnew only with managed objects.
Regards,
Nish
|
|
|
|
|
Hello,
Thank you for the quick response.
I was able to call native overridden virtual function (with no parameters) using polymorphism between Managed and Native C++ via a native DLL (compiled by VC6 compiler). I tried to extend my sample with one managed structure as parameter to the native virtual function. VC6 compiler compiled the sources and generated lib/dll for the new changes successfully.
However, I noticed below compilation error while trying to compile MC++ client using the native header:
error C3383: 'AimAdpCBBase::notify' : in an unmanaged class, a virtual member function cannot have a managed type in the signature
I read the explanation for this in MSDN. And found some articles on google stating this feature is prohibited due to performance overheads with the involved transistions from managed-native-managed. But do you know any alternative to get around this error?
One alternative may be by using gcroot template around the managed type in the native function. This might work with VC7 compiler to generate lib/dll with CLR option. But VC6 compiler doesn't know about gcroot, vcclr.h, mscorlib.dll, /clr option etc.
How to make this work between VC6 compiler and MC++ compiler?
ps:- Another question, Does gcroot support pointer to a managed struct also?
Thank you & Best Regards,
-- modified at 18:47 Monday 23rd January, 2006
|
|
|
|
|
hi;
please tell me how to create a string array
char *p[] do not work;
thanx.
Kanchana
|
|
|
|
|
hmklakmal wrote: please tell me how to create a string array
char *p[] do not work;
array<String^>^ strarr;
Regards,
Nish
-- modified at 11:28 Wednesday 18th January, 2006
|
|
|
|
|
|
toxcct wrote: very intuitive syntax though...
Yeah, it can be a tad confusing initially.
Regards,
Nish
|
|
|
|
|
Dont work that one.
Kanchana
|
|
|
|
|
hmklakmal wrote: Dont work that one.
How exactly does it not work?
Regards,
Nish
|
|
|
|
|
|
Found the problem.
StreamReader ^sr = gcnew StreamReader(File::OpenRead("test.txt"), Encoding::Default);
|
|
|
|
|
Interesting! I'd have thought, that'd have been the default.
Regards,
Nish
|
|
|
|
|
So did i...
I have found this in msdn:
ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEV.v10.en/passport25/NET_Passport_VBScript_Documentation/Single_Sign_In/Advanced_Single_Sign_In/Localization_and_LCIDs.htm
for slovenian i need to set "windows-1250", but i coudn't find any way to change to this encoding, when i have tried Encoding::Default just for fun. And it worked. I think this encoding chose it self based on windows configuration.
|
|
|
|
|
Saksida
I just went through the source (using Reflector). When you don't specify an encoding, it uses UTF8 by default. Hence your problem. Now that makes sense I guess.
Regards,
Nish
|
|
|
|
|
I can only specificy (the way i know):
UTF7
UTF8
UTF32
Unicode
ASCII
and of course Default.
but my program requires:
windows-1250
How can i set other encoder like windows-1250 without using default?
|
|
|
|