|
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"
|
|
|
|
|
When I run this code on window 98 I press button 1 it will not come out any bitmap pictuce but when I run on Windows Xp it will come out the bitmap picture. So I don't know where my problem.
|
|
|
|
|
I really don't know if this could be the problem but perhaps give it a try:
Best Friend wrote:
...
else if (nIDEvent == 2)
{
CBitmap m_bmp;
m_bmp.LoadBitmap(IDB_BITMAP2);
m_bitmap.SetBitmap(m_bmp);
KillTimer(2);
SetTimer(1, 500, 0);
}
I think it's better to make a KillTimer(1); before setting it again. Perhaps Win98 got a problem with this.
I don't know the structure of your application but for the timer1-branch I would also suggest to KillTimer(1); because you restart this timer in timer2-branch. So my solution would be:
if (nIDEvent == 1)
{
CBitmap m_bmp;
m_bmp.LoadBitmap(IDB_BITMAP1);
m_bitmap.SetBitmap(m_bmp);
KillTimer(1);
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);
KillTimer(1);
SetTimer(1, 500, 0);
}
Regards, mYkel
|
|
|
|
|
It still can not popup the bitmap picture. I has to read the MSDN on that he say LoadBitmap need to Import library User32.lib.
|
|
|
|
|
I also looked up the method in MSDN but couldn't find anything that says something about linking to user32.lib. Anyway, I found two very interesting links for you which should solve your problem.
At first try this one:
PRB: CStatic::SetBitmap Doesn't Display Bitmap on Win NT 3.51
Last reviewed: July 10, 1997
Article ID: Q151378
<a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;151378">http://support.microsoft.com/default.aspx?scid=kb;en-us;151378</a>[<a target=_blank title='New Window' href="http://support.microsoft.com/default.aspx?scid=kb;en-us;151378">^</a>] If that doesn't work either you have to do it like described here:
SAMPLE: Drawing a Bitmap in a Foundation Class Dialog Box
Last reviewed: October 23, 1998
Article ID: Q141863
<a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;141863">http: The latter is a little bit more complicated but it works to 100%. I use this way of painting bitmaps in lots of my projects
Regards, mYkel
|
|
|
|
|
why are windows in some softwares (which I think are written in delphi) like CONTEXT(the editor) or UMPS(8051 and other microcontrollers simulator) are very different to ones written in vcpp.
does different languages offer different ways to make a window look different.( i hope u understand this sentence)
|
|
|
|
|
different styles,
u can make VC windows look like VB form windows very easily
|
|
|
|
|
Hi
I badly need a chart within an application that i am building. It should accept values from the database and draw lines but however, i was faced with a major problem, LACK OF DOCUMENTATION. Can somebody, please, help me to implement a simple bar char in visual c++ 6.0.
Thank you for your precious help.
I really need this stuff quick.
Krugger
|
|
|
|