|
Generally I leave my code managed unless there is a good reason not to (performance, easier interop, etc.)
|
|
|
|
|
how to get point(x,y) where mouse click on desktop window
how to capture mouse events which will tell its position ,what button click etc.
is there any interrupt service of mouse where we can write our procedure ? to get mouse event info?
same for keborad ?
r00d0034@yahoo.com
|
|
|
|
|
please read that code and solve mine problem
tmpProcess = new Process();
tmpProcess.WaitForInputIdle();
tmpProcess.StartInfo.FileName="f:\\mirc59t";
try{
tmpProcess.Start();
while(! tmpProcess.Responding)System.Windows.Forms.Application.DoEvents();
}catch{}
tmpProcess.WaitForInputIdle();
IntPtr hWnd=tmpProcess.MainWindowHandle;
Srm=new send_recive_messages(hWnd);
/*/////////////////////////////////////////////////////
managed public __gc class send_recive_messages constructor
////////////////////////////////////////////////////*/
send_recive_messages::send_recive_messages(IntPtr par_hwnd)
{
CString cstr="";
LPTSTR str="";
hwnd=(HWND)par_hwnd.ToInt64();
//////////////////////////////////////////////////////////
HWND h=GetWindow(h,GW_CHILD);
//////////////////////////////////////////////////////////
}
///////////////////////////////////////////
h variable recive null that's why remaining code could not run.
it should not recive zero because the process main window
contain two button and four Static members.
can any body tell why it recive 0?
and what i have to do that it should not recive zero?
r00d0034@yahoo.com
|
|
|
|
|
Could someone please tell me how I would do the following cast/conversion properly? It's late and my brain no longer functions.....
Object* oFields[] = new Object* [iFields];<br />
oFields[i] = (Object __gc* )DateTime::Parse (sData.c_str ()) ;
the compiler currently tells me
error C2440: 'type cast' : cannot convert from 'System::DateTime' to 'System::Object __gc *'
give me c# any day
Thanks
Stephen.
|
|
|
|
|
Stephen -
DateTime is a value-type; it needs to be boxed first before it can be held in an Object array:
oFields[i] = __box(DateTime::Parse(sData.c_str()));
In C# boxing is done for you by the compiler (implicit boxing). In C++, because of the performance overhead associated with boxing, boxing is an explicit operation.
Give ME the full power of C++ any day
Nick
This posting is provided “AS IS” with no warranties, and confers no rights. You assume all risk for your use. © 2001 Microsoft Corporation. All rights reserved.
|
|
|
|
|
Nick Hodapp (MSFT) wrote:
Give ME the full power of C++ any day
Cool!
Maybe I'll quote you in my next MC++ article. Last time I quoted you, you had used a newly invented word - "performant" - but this time your language was more conservative
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
Nishant S wrote:
Last time I quoted you, you had used a newly invented word - "performant"
I don't think he invented the word; its one of those American words that just isn't in the dictionary
Blasted dictionaries can't always be right
James
"And we are all men; apart from the females." - Colin Davies
|
|
|
|
|
|
The C++ language, compiled for the .NET platform. A set of language extensions expose functionality of the platform itself - garbage collection, the common type system, etc.
This posting is provided “AS IS” with no warranties, and confers no rights. You assume all risk for your use. © 2001 Microsoft Corporation. All rights reserved.
|
|
|
|
|
How to Use the ToolBoxBitMap Attribute for a control Created using ManC++.
I tried the way it is done in C#, but I get an Error (Undeclared Identifier) for the Type parameter of ToolBoxBitMap Attribute .
namespace XYZ
{
[ToolboxBitmap(__typeof(MyControl))]
public __gc class MyControl : public UserControl
{
};
}
The Project also have a bitmap(with the name MyControl.bmp) as a resource.
Where am I going wrong ?
Thanks,
Firoz
|
|
|
|
|
Firoz --
I've been meaning to upload an article on this...
__typeof() doesn't work on types that haven't been fully parsed by the compiler; this will be fixed in a future release. As a workaround, place a dummy class ahead of your MyControl class and specify it instead:
namespace NickHod
{
namespace Multimedia
{
private __gc class ThisAssembly
{
};
[ToolboxBitmapAttribute(__typeof(ThisAssembly), S"CdDrive.bmp") ]
public __gc class CdDrive :
public System::ComponentModel::Component
{
The next trick is to name your bitmap using the fully qualifed namespace where the dummy-class lives. In my example above, the bitmap filename is "NickHod.Multimedia.CdDrive.bmp"
In the Linker/Input settings for your project, specify this bitmap under "Embed Managed Resource File" (the linker switch is /ASSEMBLYRESOURCE).
The other thing you'll need to do is use sn.exe to genereate a strong-name for your assembly (specified in AssemblyKeyFileAttribute() in AssemblyInfo.cpp), then register it in the GAC with gacutil.exe.
Good luck!
-Nick
This posting is provided “AS IS” with no warranties, and confers no rights. You assume all risk for your use. © 2001 Microsoft Corporation. All rights reserved.
|
|
|
|
|
Hi,
I am looking for a way to convert a double to the char representation, ie. put double, which is eight bytes, to char[8];
Example:
double nDb = 12.34;
char szDb[8];
szdB would hold the character representation of nDb which might look something like:
[0] 0''
[1] 0''
[2] 0''
[3] 0''
[4] 0''
[5] 0''
[6] 51'3'
[7] 64'@'
Thank you.
|
|
|
|
|
For native or managed code?
Something like the following would do the trick:
(in native code)
memcpy(szDb, &nDb, 8);
(with a managed array)
char __pin* temp = &szDb[0];
memcpy(temp, &nDb, 8);
This posting is provided “AS IS” with no warranties, and confers no rights. You assume all risk for your use. © 2001 Microsoft Corporation. All rights reserved.
|
|
|
|
|
I have a general question. I am using fread(...) fn in my program. I created a FILE *inFile to point to the file that i opened for read. (ie. inFile = fopen("c:\\document.bnm","r"))
I am reading 20 ascii characters at a time from the file and then send them out thru the serial port ,....i keep doing this until the end of file is reached. My file opening and reading is defined in one class called COpen and my serial communication routines are defines in a class called Tserial_event.
Once I call the function from COpen to send data thru the serial port (
com->sendData(), where com is an object of class tserial_event) and the program jumps to where the sendData fn is defined the value of inFile is lost!!!!!!!!! Originally it points to location 0x1027a898, when it jumps to sendData() it becomes 0x0000000??? and then when it returs to the fread statement to raed the next 20 characetrs it crashes, saying that I am raeding at an invalid location obviously because my pointer was lost.
My question is how should I define inFile so that it wouldn't change value when I uump to another class.
I NEED HELP ASAP IF SOMEONE CAN HELP ME
|
|
|
|
|
LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
whenever i use this in managed c++ i get a compile error of
calling convention redefinition from __clrcall to __Stdcall ignored.
is there another way of doing this in managed c++
|
|
|
|
|
|
whats IJW who to use it if i want driectly csocket class in mine managed code?
nish plz reply again
r00d0034@yahoo.com
|
|
|
|
|
These are some articles on IJW. The first one is an intro tutorial :-
http://www.codeproject.com/managedcpp/nishijw01.asp
http://www.codeproject.com/managedcpp/ijwscrcap.asp
http://www.codeproject.com/managedcpp/cbwijw.asp
http://www.codeproject.com/managedcpp/mcppshortcuts.asp
Regards,
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
|
Hi All,
I have some old Visual C++ code that I think would
work well as a "web service".
Is it difficult to convert my existing VC++ code
to .NET code?
Does that even make sense? Please help!
|
|
|
|
|
I guess there is no definite answer. I am assuming you would write the web service in Managed C++, so at least some of the code could port over with ease. You would basically just want to rewrite the application from scratch, referencing your existing app. for logical aspects. If your existing code is complex and convoluted then your web service very well could be too. Using Visual Studio.NET will definitely help you in the web service arena.
Soliant | email
"the result is that VC7 is the only compiler to generate optimized MSIL" - Stanley Lippman
|
|
|
|
|
if i got the hwnd of any process through process class
how will i convert it into HWND type?
r00d0034@yahoo.com
|
|
|
|
|
|
can any body tell if i want to inherite a managed class from csocket class how will i do it plz writ exact code i will be very thank full to u ?
and if i write a wraper class of csocket who will i over ride OnAccept and OnRecive method?
r00d0034@yahoo.com
|
|
|
|
|