|
Have you used Spy++ to look at the styles?
Have you used GetStyle and GetExStyle (and TRACE) to see what the styles are?
Have you looked at the MFC source code to see how CFormView is created?
I have used all three techniques to answer questions such as this.
|
|
|
|
|
I was wondering how is it a *.c file is linked to a *.rc file .
|
|
|
|
|
An rc file is dealt with the resource compiler, and the c file is compiled by the c complier.
The link is contained in one or more resource headers which are 'included' by both the rc file and the c file, and serve to identify the control IDs etc.
The resource compiler recognizes c preprocessor commands like #define and #include, but if other resource files are #included in the .rc they should have an rc extension. The resource compiler will not expect a .c or .h file to contain resources.
There's also a message compiler (MC), which is primarily concerned with string resources (helps when supporting multiple languages, or if you just want to compile messages for event log reporting etc.) Invoking the message compiler on a (typically named) .mc file will actually generate a header containing the resource IDs for you.
Basically, though, these are separate things. The output from the resource compiler (.res) and c compiler (.obj) will be fed to the linker to produce the executable.
|
|
|
|
|
Sorrie I need someone to explain to me the below code which is a .h file. I am very new to c++ . Thanks for helping.
#define IDM_ABOUT 100
#define IDM_CALLWNDPROC 200
#define IDM_CBT 201
#define IDM_GETMESSAGE 202
#define IDM_JOURNALPLAYBACK 203
#define IDM_JOURNALRECORD 204
#define IDM_KEYBOARD 205
#define IDM_MOUSE 206
#define IDM_MSGFILTER 207
#define IDM_SYSMSGFILTER 208
#define IDM_DEBUG 209
#define CALLWNDPROCINDEX 0
#define CBTINDEX (IDM_CBT - IDM_CALLWNDPROC)
#define GETMESSAGEINDEX (IDM_GETMESSAGE - IDM_CALLWNDPROC)
#define JOURNALPLAYBACKINDEX (IDM_JOURNALPLAYBACK - IDM_CALLWNDPROC)
#define JOURNALRECORDINDEX (IDM_JOURNALRECORD - IDM_CALLWNDPROC)
#define KEYBOARDINDEX (IDM_KEYBOARD - IDM_CALLWNDPROC)
#define MOUSEINDEX (IDM_MOUSE - IDM_CALLWNDPROC)
#define MSGFILTERINDEX (IDM_MSGFILTER - IDM_CALLWNDPROC)
#define SYSMSGFILTERINDEX (IDM_SYSMSGFILTER - IDM_CALLWNDPROC)
#define DEBUGFILTERINDEX (IDM_DEBUG - IDM_CALLWNDPROC)
#define NUMOFHOOKS 10
//
// Entry functions for the DLL
//
int FAR PASCAL InitHooksDll(HWND hwndMainWindow, int nWinLineHeight);
int FAR PASCAL PaintHooksDll(HDC hDC );
int FAR PASCAL InstallFilter (int nHookIndex, int nCode );
|
|
|
|
|
Huh? Your question doesn't make much sense. What are you trying to do?
|
|
|
|
|
That is one gigantic chunk of code, now to answer your question one would need to ask, *what part*
do you not understand? Do you have a compiler at home, like VC++ version 5 or 6. And the word
is spelled Sorry.
Dave
|
|
|
|
|
to blur : the way you spell "sorry" as "sorrie" makes me think that you are the same as the two guys
John and Loh, upstairs. A good way to get past the code that all the "sorrie" people have shown here
in the last three days is to get the book on C Programming by Kernighan and Ritchie and read in slowly.
Once you get the C language down straight then you can bounce up to C++.
C and C++ are two different animals.
These questions with 5 miles of code don't make any sense. You should try to be more specific when
you ask something, then the people will answer by the dozens.
Dave
|
|
|
|
|
Please send me a link/code piece or full source how can I grab the whole desktop into memory?
I implemented a code what can get the desktop image to memory and it can grab about 2-3 times a second. (awful slow.) I'd like to grab all sizes of desktop and any colors.
(environment, test, etc.: VC++, noMFC, WinNT4.0 SP6, source:1024x768x32, in memory 1 pixel=3bytes RGB and 1 empty byte)
Please reply me if only if you have faster solutions!!!
Thanks,Thanks,Thanks,Thanks,Thanks,Thanks,Thanks,Thanks,
---
AkelA
|
|
|
|
|
So you're grabbing 3,145,728 bytes of information 3 - 4 times per second. I don't think you're going to beat that by a large margin no matter what you do.
Speaking of that, what are you trying to do? the only way to improve your performance will be to limit the amount you're capturing, by doing delta comparisons, or intercepting the GDI calls at a lower level, I think.
D
|
|
|
|
|
Greetings,
I downloaded the CHyperLink class that is found on this site and compiled the code. That worked fine. I then went into the file HLSampleDlg and changed the line that says
m_HyperLink.SetURL(_T("mailto:cmaunder@mail.com"));
into
m_HyperLink.SetURL(_T("www.theregister.co.uk"));
Now, when I run the code, just after it opens IExplorer, I get the message
First-chance exception in HLSample.exe (KERNEL32.DLL): 0xC0000005: Access Violation.
Can anyone please help me as I haven't got a clue as to what is wrong. Thanks
Regards
Rick
|
|
|
|
|
What else do you get? What other error message and/or undesired behaviour?
|
|
|
|
|
Greetings,
I think that my first post maybe is a little bit unclear. When I modified the provided example to a hyperlink for a webpage instead of an email address, the program still runs fine(so its seems). The desired page is opened properly by Internet Explorer and I don't get any crashes or other nasties. The only thing that worries me is that as soon as IExplorer fires up I get this 'first-chance exception' in the debug window of Developer Studio and while I may be a complete newbie, I have this strange uneasy feeling that I should not really be getting this sort of messages. Here are a few lines cut&pasted from the debug window just after IExplorer fires up. Hope my explanation is clearer this time. Thanks.
Loaded 'C:\WINDOWS\SYSTEM\SHDOCVW.DLL', no matching symbolic information found.
Loaded 'C:\WINDOWS\SYSTEM\OLE32.DLL', no matching symbolic information found.
First-chance exception in HLSample.exe (KERNEL32.DLL): 0xC0000005: Access Violation.
The thread 0xFFE4B96D has exited with code 0 (0x0).
Regards,
Rick
|
|
|
|
|
http://support.microsoft.com/support/kb/articles/q105/6/75.asp
|
|
|
|
|
I've been trying to get video driver version information,
and video adapter information. I'm using VC++ and the code
needs to execute on Win95/Win NT 4.0, so that rules out
using some of the newer functionality in Win98 and Win2000.
I've tried, the following, but for the driver name I get a name that looks like a dll name (which coincidentally
exists as a name.dll in \winnt\system32). The driver version
value comes back as 0125 (0x0401). If I use the display properties->settings dialog I get a different name (ie its more like PerMedia Fire GL Pro 1000 etc) and a different
version number.
Anybody any idea what I should be doing instead of what I am doing?
decodeVersion() just swaps the DWORD value into a double
assuming that 0x0401 maps to 4.01 (which is true for other
parts of the OS, like file versions).
Hoping you can help me.
Stephen Kellett (skellett at solidworks dot com)
DEVMODE devMode;
BOOL rc;
ZeroMemory(&devMode, sizeof(devMode));
devMode.dmSize = sizeof(devMode);
rc = EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &devMode);
if (rc)
{
// got valid data, see what we've got
TCHAR text[200];
double version;
version = decodeVersion(devMode.dmDriverVersion);
_stprintf(text, _T("%s V%2.2f X%d Y%d %d bits %dHz"),
devMode.dmDeviceName,
version,
devMode.dmPelsWidth,
devMode.dmPelsHeight,
devMode.dmBitsPerPel,
devMode.dmDisplayFrequency);
}
|
|
|
|
|
|
|
Hello,
Does anyone know why the VC compiler doesn't seem template class method implementation in *.CPP module?
If I place the implementation into *.h file, everything is ok.
Here is the example:
test.h:
=====
template <class t="">
class A
{
public:
A() {};
virtual ~A() {};
int Func();
};
test.cpp:
=======
template <class t="">
int A<t>::Func()
{
asdfghjkl // It must produce compiler error!
ASDASDG
DSFGSDFG
return sizeof(T);
}
main.cpp:
=======
#include "test.h"
int main(int argc, char* argv[])
{
A<double> a;
int n1 = a.Func();
return 0;
}
The Linker can't find implementation of A::func(). If this implementation placed in test.h, everythig works fine!
|
|
|
|
|
There are no compilers out there that support this as of yet. In order to put the code in a .cpp file, the compiler needs to support the export keyword. I don't think you'll find many compilers supporting this for at least a few more years.
In the meantime, simply include your .cpp file in your .h file (I know that's backwards, but you can change it later when the compilers become conforming.
|
|
|
|
|
does anyone has an idea of how to create a playback software which records voice on a microphone and allows playback of the voice in the form a vxd ? Your help will be greatly appreciated.
|
|
|
|
|
Does anyone has a sample code of a playback software which records voice on a microphone an allows playback of the voice in c++? Thanks for replying.
|
|
|
|
|
I just started to learn VC, i got a problem now.
So,would u mind to leave your ICQ Number to me,
then i can contract u directly.Mine is 31161414.
Thank you for your kindly help!
|
|
|
|
|
Don't have ICQ - glad to help if you want to get specific.
|
|
|
|
|
I am trying for months now to create internet sessions
using proxies. The problem is not that creating the sessions
or making http connections fails, but downloading files
from the internet fails.
I have tried using CInternetSession specifying a proxy server
or letting it read the proxy-information used by IE
(INTERNET_OPEN_TYPE_PRECONFIG). Nothing ever worked.
The specific http statuscode returned was 405.
Another problem is, that I don't know how to use proxies
which need authentication. Is there a way to specify username
and password?
Would be great if anyone could help me!
Mike
|
|
|
|
|
Hi,
I am trying to display a circular image as a background with the transparency. The programs work if I use a mask image with the following operations
//draw
BitBlt(hDC, m_X, m_Y, m_X + m_Width, m_Y + m_Height, m_Image, 0, 0, SRCINVERT);
BitBlt(hDC, m_X, m_Y, m_X + m_Width, m_Y + m_Height, m_Mask, 0, 0, SRCAND);
BitBlt(hDC, m_X, m_Y, m_X + m_Width, m_Y + m_Height, m_Image, 0, 0, SRCINVERT);
where m_Image is the DC of the window
and m_Mask is the mask dc.
I try to do the same thing using Region but it don't works. Can anyone helps? Thanks
The code is like
//create th region
HBRUSH hBrush = CreateSolidBrush(RGB(0,0,0));
HBRUSH hOldBrush;
hRegion = CreateEllipticRgn(xPos, yPos, xPos + Width - 1, yPos + Height - 1);
hOldBrush = (HBRUSH)SelectObject(hDC, hBrush);
if(FillRgn(hDC, hRegion, hBrush))
DeleteObject(hBrush);
m_bUseRegion = true;
SelectObject(hDC, hOldBrush);
DeleteObject(hBrush);
// create the mask dc
m_Mask = CreateCompatibleDC(hDC);
SelectObject(m_Mask, hRegion);
DeleteObject(hRegion);
//draw
BitBlt(hDC, m_X, m_Y, m_X + m_Width, m_Y + m_Height, m_Image, 0, 0, SRCINVERT);
BitBlt(hDC, m_X, m_Y, m_X + m_Width, m_Y + m_Height, m_Mask, 0, 0, SRCAND);
BitBlt(hDC, m_X, m_Y, m_X + m_Width, m_Y + m_Height, m_Image, 0, 0, SRCINVERT);
|
|
|
|
|
How can you select a region into a DC ?
Region can only be selected as clipping region, meta region, or used in PaintRgn directly.
|
|
|
|
|