|
How do you load the pop-up (child) dialog before the program like the login screen?
|
|
|
|
|
You need to call dialog in
BOOL CMyClass::InitInstance()
{
CChildDialog dDlg;
dDlg.DoModal()
.
.
.
.
}
regards
Balkrishna Talele
|
|
|
|
|
How do I exit program when it only load the child dialog? either click OK or CANCEL for the X box, it still load the Main program. I try to use DestroyWindow() function but it give error.
|
|
|
|
|
I have a socket i am using normal blocking sockets (brekley sockets). I want to know before i call recv wheather it will become a blocking one or not. so that the socket dont block at that instance coz it is causing threading locking.
Is there any way to provide a timeout to the sockets..
i am not using MFC and so mfc CSocket is not a solution.
"When death smiles at you, only thing you can do is smile back at it" - Russel Crowe (Gladiator)
|
|
|
|
|
Try using "select" call+FD_SET
|
|
|
|
|
Thanx i guess this will solve my problem..
1.Why do people not wearing a wrist watch look at their wrist for time when people ask for time.
2.Why do people ask for time from people who are not wearing a wrist watch.
Prakash,
India.
|
|
|
|
|
Hi,
I have a CScrollView set up in one pane of an MDI splitterwindow application.
I would like the user to be able to scroll the view by clicking inside the CScrollView then dragging the mouse outside the client area. To see an example of what I mean, load up ms excel, click on a cell, then drag outside the child window (or outside the main frame of the application).
I thought I could do this by using "onmousemove" messages, calculating which way the user has dragged, and scrolling accordingly, but unfortunately I can't receive mouse coordinates when the user is outside the client area, and I only want the scrolling to occur when the user has dragged off the side of the CScrollView.
Any help would be GREATLY appreciated, thanks for your time.
Mick
|
|
|
|
|
You can use OnMouseMove() but you'll have to call SetCapture() first to capture the mouse input. Make sure you call ReleaseCapture() when you've finished.
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Thanks Ryan, that's just what I needed. It had been troubling me for days!
Thanks a lot
Mick
|
|
|
|
|
You're welcome
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
/ Initialize data form parameters
char* szFileName = argv[1]; // bitmap image's file name
// Bitmap image container
CBMPImage SrcImage;
// Loading bitmap image from file
bool ResLoad = SrcImage.LoadBMP24Image(szFileName);
Can someone explain to me wat this part of the code means..I have been trying to find out which part of this code i should change to put in my own image file
|
|
|
|
|
char* szFileName = _T("C:\\myfile.bmp"); should do it.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
When I do what u suggest, I got error which says _T is not defined integer.
|
|
|
|
|
Try adding
#include <tchar.h>
after the #include for windows.h
Steve S
|
|
|
|
|
i just want to know if this is possible to have another View Class in MDI and make some Child window that uses this View Class.
for example a list classes in a MDI:
CChildFrame
CMainFrame
CMyDoc
CMyView -> base class are CView
CMy2View -> i added this View Class that its base is not the same as CMyView base class and i want to have a Child Window that use this view class.
is this possible or any suggestion?
thanks in advance.
|
|
|
|
|
i findout smthing, i have to set a Base class to both CMDIChildWnd and my own base class. and it seems that i have to Set BEGIN_MESSAGE_MAP(CMy2View, CMDIChildWnd)
is it true that the only way that a Child Window obey a View class is to make it with this line : CMDIChildWnd::Create(...)
So to having a ChildWindow i have to set base to CMDIChildWnd and then i will lose my own base class, i mean i cant use OnPaint() Coz i have to set Message map to CMDIChildWnd.
Any Suggestion ?
|
|
|
|
|
I am working on an external device that I'm trying to interface through the parallel port. To get adequate speeds, I'm looking to use EPP instead of regular CENTRONICS. The problem is, I get the following output when I try to write to the port after negotiating the protocol.
<br />
Opening LPT1... OK<br />
Querying LPT1 Status...<br />
Status: 80<br />
Setting EPP Mode...<br />
Querying LPT1 Mode...<br />
Read Status: 40<br />
Write Status: 40<br />
Sending data...<br />
Error: Incorrect function.<br />
<br />
Sent 0 values<br />
Sending complete...<br />
The Read and Write status indicate that I've negotiated to EPP. However, I get the shown error. Here is the code snippet of what I'm doing
<br />
printf("Opening LPT1...\t");<br />
hParPort = CreateFile("LPT1", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);<br />
<br />
printf("Querying LPT1 Status...\n");<br />
PAR_QUERY_INFORMATION ParInfo;<br />
DeviceIoControl(hParPort, IOCTL_PAR_QUERY_INFORMATION, NULL, 0, &ParInfo, sizeof(ParInfo), &ret, NULL);<br />
printf("Status: %x \n", ParInfo.Status);<br />
<br />
printf("Setting EPP Mode...\n");<br />
PARCLASS_NEGOTIATION_MASK parMode;<br />
PARCLASS_NEGOTIATION_MASK parModeBack;<br />
parMode.usReadMask = EPP_ANY;<br />
parMode.usWriteMask = EPP_ANY;<br />
DeviceIoControl(hParPort, IOCTL_IEEE1284_NEGOTIATE, &parMode, sizeof(parMode), &parModeBack, sizeof(parModeBack), &ret, NULL);<br />
printf("Read Status: %x \n", parModeBack.usReadMask);<br />
printf("Write Status: %x \n", parModeBack.usWriteMask);<br />
<br />
printf("Sending data...\n");<br />
<br />
if(!WriteFile(hParPort, data, 1, &ret, NULL))<br />
{<br />
}<br />
printf("Sent %d values \n", ret);<br />
printf("Sending complete...\n");<br />
CloseHandle(hParPort)<br />
Any ideas as to why I get an invalid function and what I can try instead of WriteFile?
Jane
|
|
|
|
|
I'm using class CVolumeOutMaster - it sets and gets master volume. The class could be found here: http://www.codeproject.com/audio/volumeclasses.asp
It determines the volume like this:
DWORD CVolumeOutMaster::GetCurrentVolume()
{
if ( !m_bAvailable )
return BAD_DWORD;
MIXERCONTROLDETAILS_UNSIGNED* aDetails = (MIXERCONTROLDETAILS_UNSIGNED*)malloc(m_nChannelCount*sizeof(MIXERCONTROLDETAILS_UNSIGNED));
if ( !aDetails )
return BAD_DWORD;
MIXERCONTROLDETAILS ControlDetails;
memset( &ControlDetails, 0, sizeof(MIXERCONTROLDETAILS) );
ControlDetails.cbStruct = sizeof(MIXERCONTROLDETAILS);
ControlDetails.dwControlID = m_dwVolumeControlID;
ControlDetails.cChannels = m_nChannelCount;
ControlDetails.cMultipleItems = 0;
ControlDetails.cbDetails = sizeof(MIXERCONTROLDETAILS_UNSIGNED);
ControlDetails.paDetails = &aDetails[0];
MMRESULT mmResult = mixerGetControlDetails( (HMIXEROBJ)m_dwMixerHandle, &ControlDetails, MIXER_GETCONTROLDETAILSF_VALUE );
DWORD dw = aDetails[0].dwValue;
free( aDetails );
if ( mmResult != MMSYSERR_NOERROR )
{
TRACE(".MasterOutputVolume: FAILURE: Could not get volume. mmResult=%d\n", mmResult );
return BAD_DWORD;
}
return dw;
}
How to determine whether master volume is enabled or disabled?
|
|
|
|
|
My app leaks a CArchiveException when an (expected) exception occurs. If I try to fix the leak by deleting the exception (using either [a] or [b]), the framework ASSERTs that the exception isn't ready for deletion. Any clues as to how I can fix the leak?
status = Success;
try {
if (pArchive->IsStoring())
(*pArchive) << m_tmLogin;
else
(*pArchive) >> m_tmLogin;
}
catch (CException* pExc) {
status = Error;
}
return (status);
Thanks,
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
call pExc->Delete() inside catch block
|
|
|
|
|
|
hello..
i want to display whatever user input in the edit box to hex with a click of a button.. i want to display the characters in ascii codes..
can someone teach me how to do it?
thankss
~wilD cat~
|
|
|
|
|
|
Who can help my for below this code it just can operate window 2000, Xp or above. Now my problem is how I can modify this code to operate on Window 98 because my PC is using Window98. OR you has any example like this.
if (nIDEvent == 1)
{
CBitmap m_bmp;
m_bmp.LoadBitmap(IDB_BITMAP1);
m_bitmap.SetBitmap(m_bmp);
KillTimer(2);
SetTimer(2, 500, 0);
}
else if (nIDEvent == 2)
{
CBitmap m_bmp;
m_bmp.LoadBitmap(IDB_BITMAP2);
m_bitmap.SetBitmap(m_bmp);
KillTimer(2);
SetTimer(1, 500, 0);
}
Thanks.
|
|
|
|
|
This code should work correctly on Windows 98. Is it working?
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|