|
The problem is that the view is not properly closed. But even if you would close it properly, there will be other problems. A CView is not designed to be a child view of a dialog. It must be a child of a CFrameWnd derived class. Change your CView class to be based on a CWnd .
|
|
|
|
|
And demonstrating a great deal of restraint as well. Good for you.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
|
|
|
|
|
wherever i used GetDc() i have done ReleaseDC...Still the error is coming, "A required resource was unavailable". Please help me to resolve this. why 2nd time my application is not launching.? please tell whatelse I need to do ? Thanks
|
|
|
|
|
sujandasmahapatra wrote: please tell whatelse I need to do ?
You probably need to do some serious debugging, firstly to find out why and where this message is produced.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
it's giving this error
First-chance exception at 0x7c812afb in TestRev.exe: Microsoft C++ exception: CResourceException at memory location 0x0012ed28..
Crashing in wincore.cpp -- AfxRegisterClass(WNDCLASS* lpWndClass)
|
|
|
|
|
And what does that tell us? Pretty much nothing. You need to look at your code where this error occurs and find out what your program is doing, or trying to do: that is where the error lies.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Can u give me your mail id so that I can send you the project. Can u help me ?
|
|
|
|
|
Sorry, but I don't want to write your code. I - and most others here - just enjoy helping.
The design of your application is definitely broken. That is your problem. Tampering with the existing code is the wrong way. Reconsider the design. Read about dialogs hosting user controls.
|
|
|
|
|
I have got the problem I have implemented the PrecreateWindow for my view class.
just check this code.
[code]
BOOL CMyView::PreCreateWindow(CREATESTRUCT& cs)
{
cs.lpszClass = ::AfxRegisterWndClass(CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS | CS_OWNDC,::LoadCursor(NULL, IDC_ARROW), NULL, NULL);
cs.style |= WS_CLIPSIBLINGS | WS_CLIPCHILDREN;
cs.dwExStyle = WS_EX_CLIENTEDGE;
return CView::PreCreateWindow(cs);
}
[/code]
If I remove the first line, i.e
cs.lpszClass = ::AfxRegisterWndClass(CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS | CS_OWNDC,::LoadCursor(NULL, IDC_ARROW), NULL, NULL);
then my dll window is coming all the times from the client call. But it's flickering .
So now please help me what can I do to resolve this. I think some of you must have understood the problem, please help me. Thanks a lot.
|
|
|
|
|
hi all,
can any one help me to read USB type Disk Drive device.
please help me from where i can start.
thanks in advance.
|
|
|
|
|
Please make an effort to try this[^] first.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
can u please more specific,how to detect and open this
coz its not open using serial port and CreateFile method.
thanks.
|
|
|
|
|
Le@rner wrote: can u please more specific
Afraid not; as with most questions like this, you need to go and do some research into what features are available and how you can implement them to solve your problem(s).
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
What are you trying to accomplish? ...this question is not clear. If it's a plain storage disk drive, and you're trying to read/write to it, it's the same as reading and writing to any file on your C:\. You just have to specify the full path of the files. The IO is handled by the drivers.
|
|
|
|
|
i want to access the Card reader that is connect as drive.
|
|
|
|
|
What do you want to do though? Are you trying to write to it? Do you not know what logical drive was assigned to it? Be more specific.
|
|
|
|
|
i just want to read this?and read data of smart card is inserted in it.
|
|
|
|
|
Have you tried ReadFile()?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
it means open it with CreateFile?
what parameter pass here for file name like \\.\driveletter: or anything else.
when i CreateFile using "\\.\driveletter:" and ReadFile than its return 0 and getlasterror is "The Parameter is incorrect".
and when i open it as physicaldrive its give "the device is not ready"
so now waht can i do?
and also tell me how can i diffrentiate this from other drive.
please guide me.
thanks.
modified 5-Mar-12 0:11am.
|
|
|
|
|
Le@rner wrote: what parameter pass here for file name like \\.\driveletter: or anything
else.
See this discussion.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
HDEVINFO hDevInfo, hIntDevInfo;
BOOL disk_status=FALSE;
hDevInfo = SetupDiGetClassDevs(
(LPGUID) &GUID_DEVCLASS_DISKDRIVE,
NULL,
NULL,
DIGCF_PRESENT ); if (hDevInfo == INVALID_HANDLE_VALUE)
{
return 0;
}
hIntDevInfo = SetupDiGetClassDevs (
(LPGUID)&GUID_DEVCLASS_DISKDRIVE,
NULL, NULL, (DIGCF_PRESENT | DIGCF_INTERFACEDEVICE ));
if( hDevInfo == INVALID_HANDLE_VALUE )
{
return 0;
}
SP_DEVICE_INTERFACE_DATA interfaceData;
PSP_DEVICE_INTERFACE_DETAIL_DATA interfaceDetailData = NULL;
PUCHAR disk_p;
UCHAR outBuf[512];
ULONG length = 0,
returned = 0,
returnedLength=0;
DWORD interfaceDetailDataSize,
reqSize,
errorCode,
disk_i=0;
DWORD Index=0;
interfaceData.cbSize = sizeof (SP_INTERFACE_DEVICE_DATA);
disk_status = SetupDiEnumDeviceInterfaces (
hIntDevInfo, 0, (LPGUID)&GUID_DEVCLASS_DISKDRIVE, Index, &interfaceData );
if ( disk_status == FALSE )
{
errorCode = GetLastError();
if ( errorCode == ERROR_NO_MORE_ITEMS )
{
}
else
{
}
return 0;
}
disk_status = SetupDiGetDeviceInterfaceDetail (
hIntDevInfo, &interfaceData, NULL, 0, &reqSize, NULL );
if ( disk_status == FALSE )
{
errorCode = GetLastError();
if ( errorCode != ERROR_INSUFFICIENT_BUFFER ) {
return 0;
}
}
interfaceDetailDataSize = reqSize;
interfaceDetailData = (PSP_DEVICE_INTERFACE_DETAIL_DATA) malloc (interfaceDetailDataSize);
if ( interfaceDetailData == NULL )
{
return 0;
}
interfaceDetailData->cbSize = sizeof (SP_INTERFACE_DEVICE_DETAIL_DATA);
disk_status = SetupDiGetDeviceInterfaceDetail (
hIntDevInfo, &interfaceData, interfaceDetailData, interfaceDetailDataSize, &reqSize, NULL);
if ( disk_status == FALSE ) {
return 0;
}
serial_handle = CreateFile(
interfaceDetailData->DevicePath, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL );
Open device successfullt, but read file return 0;
success = ReadFile(serial_handle,&rxBuffer,max_rx_size,&read_nbr,NULL);
please help me where i m wrong
|
|
|
|
|
Le@rner wrote: please help me where i m wrong
You've failed to say what is wrong.
Have you used the debugger to step through the code?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
|
And then what did GetLastError() return?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
GetLastError return "0x00000456 The media in the drive may have changed. "
|
|
|
|