|
|
China_Boy wrote: access violation
dude, give us some infos !!!
Where ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
China_Boy wrote: access violation
generally result from accesing unintialized memory
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
how much does the pre-compile header help to reduce the compile time?
|
|
|
|
|
If your project is more than a couple of files - lots!
--
The Blog: Bits and Pieces
|
|
|
|
|
Hi,
i hold a pointer to an instance of an unmanaged c++ class in my managed c++ class. just like in the example i found on msdn.
msdn example
This example don't works. I get an unresolved extern symbol error, caused by calling m_pC = new CppClass();
Is there anybody who can tell me how i can create an instance of this CppClass?
Thanks
|
|
|
|
|
the only reason an "unresolved symbol" could occur on such a line is when you declared your CppClass class in its own .h header file, and forgot to #include"" this header in the .cpp file that uses it...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
no... everthing is declared in the same header file. I really have no idea what i do wrong.
I just take the given example into one header file.
|
|
|
|
|
so, what it the exact denomination of the error please ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
error LNK2001: Nichtaufgelöstes externes Symbol "void * __cdecl operator new(unsigned int)" (??2@$$FYAPAXI@Z)
and
error LNK2001: Nichtaufgelöstes externes Symbol "void __cdecl operator delete(void *)" (??3@$$FYAXPAX@Z)
here the source.
using namespace System;
namespace CTest
{
class CppClass
{
public:
CppClass() {}
~CppClass() {}
void native_f() {}
};
__gc class MClass
{
public:
MClass() { m_pC = new CppClass(); }
~MClass() { delete m_pC; }
void managed_f() { m_pC->native_f(); }
private:
CppClass * m_pC;
};
}
|
|
|
|
|
How can I move a window from one desktop to another?
In my program I use two desktops created by me. SetThreadDesktop(...) don't work.
Thank you.
- NS -
|
|
|
|
|
Hi All,
I wanna get the width and height of a character with font "Arial" or any fonts, do you have any solution for this case ?
Thanks
|
|
|
|
|
Try GetTextExtent - this will give you the width/height of a string (make sure the corrent font is selected into the DC). There is more than one way to do this - maybe others will respond...
The Rob Blog Google Talk: robert.caldecott
|
|
|
|
|
kendao wrote: I wanna get the width and height of a character with font "Arial" or any fonts, do you have any solution for this case ?
Is GetCharWidth() api of any help
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
i have an ADC device. the manufacturer provided a dll .lib and .h to operate the device. But he hasnt mentioned if the dll is release or debug. I used the dll in release and debug mode programs and found it to work in both. Can a dll work in both release and debug mode programs?
The manufacturer doesnt have any idea of release and debug dlls?
|
|
|
|
|
It's most likely a release version. It will work in debug and release builds of your code, as long as you use the same kind of runtime library (Multithreaded (DLL) vs Single-Threaded)
If you try to single-step into a function (during a debug session) and the debugger jumps to the next line in your code, then the dll is definately a release version.
|
|
|
|
|
Hello,
I need to do programming on serial port. (sending & receiving data from serial port)
Which is the best method: using MSComm or Win32 programming(CreateFile)?
And where I can get good material to understand the concept?
Thanking you,
Regards,
mysticlol
|
|
|
|
|
Hello.
There are several articles and helper classes here on CodeProject.
IMO, it's worth considdering using a ready-made class, since serial IO must use overlapped IO.
|
|
|
|
|
I tried to use the MSComm but could not find
sufficient material to code by using MScomm
(if u get some small app then email me )
Have use the Win32 prog that works fine with
my application now.
If u need will send u the files
thank you
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
hello vikas,
Thank you very much for your helping hand.
I was also trying my hand using CreateFile(), WriteFile(), ReadFile() & FlashFileBuffers() in Win32, but these boolean functions were giving me "false" outpuit.
I was going through tutorials of codeproject, and I got "http://www.codeproject.com/system/serial.asp" by Ramon De Klein.
This washed out all my problems.
Now I have to sit & understand, where I was doing mistakes.
Any way Vikas,
Thank you,
Regards,
mysticlol
|
|
|
|
|
Hello,
I need to do programming on serial port.
Which is the best method: using MSComm or Win32 programming(CreateFile)?
And where I can get good material to understand the concept?
Thanking you,
Regards,
mysticlol
|
|
|
|
|
Hi everybody. I've been working at an article about Inter-Process communication that I also intend to post here when finished ::- ). However, I do have one last issue to solve. A quite difficult issue. I want to pass an array from VC++ to VB. From VB to VC++ I made it work quite easy, but I am having trouble doing it the other way around.
As I learned, Visual Basic works with array using SAFEARRAYs. Now. For example, to call a VB function from a VC++ DLL you gotta do this:
void CallVBFunctionForNumber (long lSomeValueToSend)<br />
{<br />
typedef void (__stdcall *OutsideFunction)(long AValue);
OutsideFunction FunctionCall;
FunctionCall = (OutsideFunction)extNumberProc;
FunctionCall(lSomeValueToSend);
}
extNumberProc is an address which was previously received from VB. To call that function all you gotta do in VC++ is this:
CallVBFunctionForNumber(20);
And now here's the function for calling a function from Visual Basic which should accept an array. First, here's the VB function.
'FUNCTION CALLED FROM THE VC++ DLL.<br />
Public Sub ArrayDemoFunction(ByRef Something As Variant)<br />
MsgBox Something(2)<br />
End Sub
and the VC++ function
void CallVBFunctionForArray ()<br />
{<br />
typedef void (__stdcall *OutsideFunction)(VARIANT *AValue);
OutsideFunction FunctionCall;
FunctionCall = (OutsideFunction)extArrayProc;
<br />
VARIANT *pVariant = NULL;
SAFEARRAY *sarrVC;
SAFEARRAYBOUND sabBound = { 10, 0 };
<br />
VariantInit (pVariant);
pVariant->vt = VT_ARRAY | VT_I4;
sarrVC = SafeArrayCreate(VT_I4, 1, &sabBound);
for (long iCounter = 0; iCounter < 10; iCounter++)
SafeArrayPutElement(sarrVC, &iCounter, &iCounter);<br />
pVariant->parray = sarrVC;
FunctionCall(pVariant);
}
Executing the above VC++ function works, until calling the VB function. When that happens, everything comes crashing down with an "Unhandled exception in Testapp.exe (OLEAUT32.DLL): 0xC00000005: Access Violation.".
For your reference, here's an article which I used to create the code:
http://www.microsoft.com/msj/0599/wicked/wicked0599.aspx[^]
So... ideas anybody? ::- )
-= E C H Y S T T A S =-
The Greater Mind Balance
-- modified at 1:44 Friday 4th November, 2005
|
|
|
|
|
Try adding VT_BYREF to the vt for your variant
pVariant->vt= VT_ARRAY | VT_I4 | VT_BYREF
Just a thought.
|
|
|
|
|
Hello, everyone!
Who can tell me , what's the meaning of "USES_CONVERSION"?
Thanks a lot!
|
|
|
|
|