I have an NT Service program written with VC++ 6.0 as ATL/COM components that runs on W2K or XP. Now I want to upgrade to VC++ 2005 but not sure where to start. It has nothing at all to do with the web, just processes database requests from clients on wireless scanning devices. The wireless device needs some data from a database, calls my service which processes the request, formats the data for the device then returns the formatted data all through various COM calls.
I guess my question is: is there any advantage to migrating to VC++ 2005 other than getting a new compiler? Are there any books you would recomment that might help me migrate the program to managed c++?
I have written a WndProc() function that detects the insert and removal of a USB drive and
want to pull out the specific LParam values to get the name of the drive and other info.
The examples I've found so far use a particular C# code that goes like this...
public struct DEV_BROADCAST_VOLUME<br />
public int dbcv_size;<br />
public int dbcv_devicetype;<br />
public int dbcv_reserved;<br />
public int dbcv_unitmask;<br />
protected override void WndProc(ref Message m)<br />
const int WM_DEVICECHANGE = 0x0219;<br />
const int DBT_DEVICEARRIVAL = 0x8000; // system detected a new device<br />
const int DBT_DEVTYP_VOLUME = 0x00000002; // logical volume<br />
//we detect the media arrival event<br />
if (m.Msg == WM_DEVICECHANGE && m.WParam.ToInt32() == DBT_DEVICEARRIVAL)<br />
int devType = Marshal.ReadInt32(m.LParam,4);<br />
if(devType == DBT_DEVTYP_VOLUME)<br />
DEV_BROADCAST_VOLUME vol;<br />
vol = (DEV_BROADCAST_VOLUME) Marshal.PtrToStructure(m.LParam,typeof(DEV_BROADCAST_VOLUME));<br />
base.WndProc (ref m);<br />
And I've been trying to get the LParam into my structure like this:
This continues to not work in MC++.
For some reason I cannot find a viable alternative to the C# code in MC++. My errors include
the dreaded run-time:
"The specified structure must be blittable or have layout information..."
among other more standard compile errors for instantiating the structure incorrectly.
I know theres a way to do this but havent found it yet.
Any help you all could be would be greatly appreciated!
I have to create a GUI which control the camera.in my GUI i need to create a mouse stick which controls the camera like rotate left or right. but i get stuck on the mouse stick.In order to create this mouse stick where should i start.
Hey guys, I am trying to understand some codes and came across this.
In the code below, I don't know if its a pointer to RTIambassador object. I don't see why there is RTI:: in front of RTIambassador* and also ms_rtiAmb is not a method of class ObjectRoot. I don't see why they have ObjectRoot:: in front of ms_rtiAmb.
I've got an unmanaged C++ library which I've now compiled as a managed assembly (changed the output type etc.) When I try to use this in another Managed C++ project, I get C2871 - a namespace with this name does not exist. I have tried using both:
#using (with the Resolve #using references setting)
Adding a reference (automatic /FU switch)
but neither works; I still get C2871 on the first "using namespace" line.
The really strange thing is that I have built a test c# application and this is able to use the assembly just fine!
Thanks for the advice. The strange thing is, I've already checked this.
ildasm.exe shows the namespace just as I'm trying to use it and C# uses it without a problem. The Managed C++ compiler picks up the dll from the #using statement but can't seem to find the namespace in a subsequent "using namespace ..." statement.
I've tried using a different dll in the project and this works OK. I've also tried compiling the included dll in a complete new project - same problem. So it seems to be something wrong with this particular dll. I just don't understand how the C# compiler can see the namespace whereas the C++ one can't.
Ideally I want to get the C++ compiler to verbosely tell me exactly what it's searching and what it 'sees'. I guess that's not possible!