|
Hello,
I am making a virtual disk driver based on filedisk,
it is working very well under winxp but when i unmount the drive it doesn't disappear, instead it appears with a question mark
however it formats with all file systems under winxp.
on win 2000, it formats only under NTFS, not fat and fat32.
can u please help me with these 2 problems,
i mean the question mark under xp and the format problem under win2k
thanks in advance
Ahmed Abbas
|
|
|
|
|
Where can you create your virtual drive?
ps: This question supposted to be under "Operating Systems / SysAdmin" not in C++/CLI aka managed c++
|
|
|
|
|
Hi fellows
Someone knows how can I convert a BYTE to an integer?
Thanks
|
|
|
|
|
You should be able to use
BYTE myByte = 4;
int myInt = (int) myByte;
There is probably some newfangled way to do this, but C-style casting usually works for me.
C++ can use cooler casting operators, just google "c++ casting." But in this case C++ casting is probably unnecessary.
|
|
|
|
|
if it's a BYTE *, then int n = (int)*myBytePtr; should do it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian Graus wrote:
if it's a BYTE *, then int n = (int)*myBytePtr; should do it.
Yeah, but it would be much better to cast to DWORD_PTR instead.
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
not really since he's dereferencing the pointer.
but if it were this: int n = (int)myBytePtr, then yes, int n = (INT_PTR)myBytePtr may be better.
|
|
|
|
|
Hi
I want to hide an icon (of another process) from the System tray. Is it possible?
|
|
|
|
|
Hi all,
I am writing a simple application in VS.NET 2003 which uses my own dll (vz.dll). The dll is for my C++ library which the application uses. See the scenario below:
app (my own application) --> uses vz.dll (a C++ API exporting its class functions, my own classes). I am building the DLL with /MTd flag enabled rather than using flag /MDd. Also I am calling the constructor within the DLL with new.
Debugging the application, when I exit the application I do deletion of my data(calling delete on an instance created using new) I get the following exception with the stack trace
Unhandled exception at 0x7c822583 in app.exe: User breakpoint
ntdll.dll!7c87512a()
ntdll.dll!7c8754d1()
ntdll.dll!7c8409a8()
kernel32.dll!77e6b28e()
kernel32.dll!77e755b9()
vzclient.dll!_CrtIsValidHeapPointer(const void * pUserData=0x01da27a0)
Line 1807 C
vzclient.dll!_free_dbg_lk(void * pUserData=0x01da27a0, int nBlockUse=1)
Line 1132 + 0x9 C
vzclient.dll!_free_dbg(void * pUserData=0x01da27a0, int nBlockUse=1)
Line 1070 + 0xd C
vzclient.dll!operator delete(void * pUserData=0x01da27a0) Line 54 +
0x10 C++
vzclient.dll!vzTMRenderAction::`scalar deleting destructor'() +
0x3c C++
app.exe!CleanVolumizer() Line 438 + 0x34 C++
I commented out the deletion of the data which was causing this. After which I am still getting the same exception
Unhandled exception at 0x7c822583 in app.exe: User breakpoint.
But now the location of exeption has shifted to dbgheap.c when the _CrtIsValidHeapPointer returns.
Though it seems to me a heap corruption but I have no clue why it is happening and where. I also tried using gflags utility but not of much use.
Please help me, I am stuck.
Any help/ suggestion is welcome.
Thanks in advance,
Divick
|
|
|
|
|
you're probably deleting an object multiple times or the memory is being overwritten, possibly because of a dangling pointer. It could also be an uninitialized pointer. A dangling pointer is one that points to unallocated memory that was once allocated but is now being used by some other object. Later on, the program overwrites some object through the dangling pointer.
good luck.
memory problems are some of the hardest nuts to crack. but it'll put hair on your chest (LOL).
|
|
|
|
|
Hi,
within one of my DLL (using unmanged C++) I throw an exception of a user defined type (altenatively std::string - this caused the same result). In my .net solution that uses this DLL I've put everything into a try-catch block.
The exception seems to be thrown correctly by the DLL, but the only thing my .net application receives is an exception of type System::Runtime::InteropServices::SEHException, accompanied by the message:
"External component has thrown an exception."
Does anyone know how this is done right? Will it work at all?
|
|
|
|
|
Did you try to use:
try
{
/*some code*/
}
catch (System::Runtime::InteropServices::SEHException *)
{
}
|
|
|
|
|
Sure, but the SEHException doesnt contain anything of MY exception. I tried to simply throw an integer error code and this is later a member of the SEHException. So there is some way of interaction between the exceptions...
|
|
|
|
|
|
Great,
that is exactly the information I searched for - perhaps i should have had a longer try searching MSDN for this.
It's working fine now..
|
|
|
|
|
need sourcecode on checkers software with neural network and genetic algorithm coded in it to make computers play checkers
-- modified at 17:22 Monday 10th October, 2005
|
|
|
|
|
Sure - where should I send my quote ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
to linux_addict1978@hotmail.com
i need a program the program should take as input 2 intgers and the operation to be performed.It should then output the numbers,the operator and the result
|
|
|
|
|
LOL - what's this about ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
You need it for an assignment ? There I was thinking it was a real world application - not. I know you're trying to cheat on your homework, I'm trying to give you a feel for how the real world works ( do you own homework, in other words )
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi for all
Fellows, in my application I'm drawing a font(arial, size: 50).
When the font is displayed their appearance is not so good, it seems that some parts of letters are vertically cutted.
I've put the glHint function, like this:
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
And this is my method that draws the font:
void ImprimeTexto(unsigned int iFont, const char* cValue)
{
if(iFont == 0) MessageBox(0,"Fodeu", "tela",0);
glPushAttrib(GL_LIST_BIT);
glHint(GL_PERSPECTIVE_CORRECTION_HINT,GL_NICEST);
glListBase(iFont - 32);
glCallLists(strlen(cValue), GL_UNSIGNED_BYTE, cValue);
glPopAttrib();
}
My screen resolution is 1024x768.
I don't know what's going on, anyone can help me?
|
|
|
|
|
Hi fellows
I'm need to capture a screen in my app, but I have no idea how I can do this or where I start. Can someone help with this saying where I can get some information about how and where to start?
Thanks a lot
Alex Cutovoi
|
|
|
|
|
Since there is no such thing as a screen in C++ I assume you mean the WindowsAPI. Are you using opengl as I see you have a question about opengl above??
John
-- modified at 12:55 Monday 10th October, 2005
|
|
|
|
|
|
John, I've read that article that you said. I don't understand almost all, it's complicated. Well, I got made this, is this correct??
At this point I'm completely lost, I don't know what is the next step. I'll try to understand.
void CapturaTela()
{
int iWidth = GetSystemMetrics(SM_CXSCREEN);
int iHeight = GetSystemMetrics(SM_CYSCREEN);
HWND screenHwnd;
HDC screenHdc;
HDC copyHdc;
HBITMAP newBitmap;
screenHwnd = GetDesktopWindow();
screenHdc = GetDC(screenhwnd);
copyHdc = CreateCompatibleDC(screenHdc);
HBITMAP bitmap = CreateCompatibleBitmap(screenHdc, iWidth, iHeight);
SelectObject(copyHdc, bitmap);
BitBlt(copyHdc, 0, 0, iWidth, iHeight, screenHdc, 0, 0, SRCCOPY);
newBitmap = bitmap;
}
|
|
|
|