|
You should review the web site of Reliable Software.
http://www.relisoft.com
They have many tutorials and discussions on writing 'reliable' software.
There are also C++ tutorial and C++ code sections.
Their page "Sampling Sound in Windows 32" will help you out.
http://www.relisoft.com/recorder.html
|
|
|
|
|
how is it with templates using?
then i use the same template in more source files it is expandend in every one of them (the same way) so final exe file is big(ger)?
do i understand it well?
is any optimalization/pragma what will say expand in this file only and all other files will take it a a extern?
thanks for reply
t!
|
|
|
|
|
How to easily but quickly rotate a DC or a bitmap by any angle ? Is there a ready made class somewhere ?
|
|
|
|
|
Hi,
I'm coding a Visual C++ Add-In, and I want to add a child
window, from my Add-In, to Visual C++. How can I do that?
How do I add docking control bar?
Thanks.
|
|
|
|
|
I am developing an application in which a user will edit some data which will later on be converted into a Microsoft Word document. The data will be stored in serializable classes. While I do use an edit control for simple text, how do I provide the interface of editing a table? shall I use a grid control? Or shall I how make my application OLE container into which the user edits the document using Word interface.........but if I take this approach, how can I serialize a Word object in my class.....My class which will hold the data (data which will be used to create a word document) is derived from CCmdObject and has many CString and CStringArrays. Right now I am just thinking of adding more CString and CStringArray which will hold some data and I will use automation to write the data in a Word document.
|
|
|
|
|
Hi,
when I print from my application, I always get 2 pages.
How do I resize the output so that it matches on one
page ?? (i.e. zooming to 75 % ??)
Thanks in advance,
Dennis Voss
|
|
|
|
|
hi!
i'm a newbie to win32 programming. :/
how do i use and translate accelerator keys?
i.e: pressing 'A' will bring up an open dialog, etc.
thanks.
|
|
|
|
|
I have (without success) been trying to use the SDK call GDIComment() (CDC::AddMetaFileComment()) to create groups in a drawing I put on the clipboard as a metafile. I'm sure I'm doing something stupid. Amazingly, there is little or no documentation of this in the Platform SDK.
Here is a simple example of what I'm trying to do (from OnDraw()), :
CPen pen(PS_SOLID, 2, RGB(0,0,0));
CPen* pOldPen = (CPen*)pDC->SelectObject(&pen);
#pragma pack(push, 1)
// byte array for begingroup
struct {
UINT ident;
DWORD iComment;
RECTL rclOutput;
DWORD nDescription;
} beginBuf;
// byte array for endgroup
struct {
UINT ident;
DWORD iComment;
} endBuf;
// if this is a metafile DC, create the first group
if (dynamic_cast<cmetafiledc*> (pDC))
{
beginBuf.ident = GDICOMMENT_IDENTIFIER;
beginBuf.iComment = GDICOMMENT_BEGINGROUP;
beginBuf.rclOutput.top = 0;
beginBuf.rclOutput.bottom = 200;
beginBuf.rclOutput.left = 0;
beginBuf.rclOutput.right = 200;
beginBuf.nDescription = 0;
BOOL bRet = ::GdiComment(pDC->GetSafeHdc(), sizeof(beginBuf), (const unsigned char *)&beginBuf);
if (!bRet)
{
ASSERT(0);
int iRet = GetLastError();
}
}
// draw an X
pDC->MoveTo(0,0);
pDC->LineTo(200,200);
pDC->MoveTo(200,0);
pDC->LineTo(0,200);
// end the first group
if (dynamic_cast<cmetafiledc*> (pDC))
{
endBuf.ident = GDICOMMENT_IDENTIFIER;
endBuf.iComment = GDICOMMENT_ENDGROUP;
BOOL bRet = ::GdiComment(pDC->GetSafeHdc(), sizeof(endBuf), (const unsigned char *)&endBuf);
if (!bRet)
{
ASSERT(0);
int iRet = GetLastError();
}
// begin the second group
beginBuf.ident = GDICOMMENT_IDENTIFIER;
beginBuf.iComment = GDICOMMENT_BEGINGROUP;
beginBuf.rclOutput.top = 205;
beginBuf.rclOutput.bottom = 415;
beginBuf.rclOutput.left = 0;
beginBuf.rclOutput.right = 200;
beginBuf.nDescription = 0;
bRet = ::GdiComment(pDC->GetSafeHdc(), sizeof(beginBuf), (const unsigned char *)&beginBuf);
if (!bRet)
{
ASSERT(0);
int iRet = GetLastError();
}
}
// draw an X further down the screen
pDC->MoveTo(0,210);
pDC->LineTo(200,410);
pDC->MoveTo(200,210);
pDC->LineTo(0,410);
// end the second group for a metafile DC
if (dynamic_cast<cmetafiledc*> (pDC))
{
endBuf.ident = GDICOMMENT_IDENTIFIER;
endBuf.iComment = GDICOMMENT_ENDGROUP;
BOOL bRet = ::GdiComment(pDC->GetSafeHdc(), sizeof(endBuf), (const unsigned char *)&endBuf);
if (!bRet)
{
ASSERT(0);
int iRet = GetLastError();
}
}
pDC->SelectObject(pOldPen);
|
|
|
|
|
Hi,
I'm writing an Add-In for Visual C++. I want to create a docking dialog bar of my own, that will dock the
Visual C++ window (similarly to the class/resource/file view dialog bar that's already there), but have
absolutely no idea how to idea. I've seen another Add-In that did it (it's commercial, so that there's no
source code).
There's an Add-In on this site (WinTabs) which implements a docking tab control. I tried to look for the
way it was done, but the code is rather complicated and big. I'm not even sure whether it would work for
a dialog bar.
Any help would be greatly appreciated
Thanks.
|
|
|
|
|
|
Thanks, but this doesn't help much, because what I'm trying
to do is create a child window (or a child dialog bar) to a
window from another process. Therefore, I have only a CWnd
object of that outer window but can't get its CFrameWnd.
|
|
|
|
|
We want to use some selfdefined ID's for the Toolbar Buttons.
Is there anything where I can look up the range of ID we are allowed to use?
We want to define them in a special header...
...like:
#define TOOLID_ZOOM 5666
Are there some ID's I am not allowed to use?
Is there anything about this in the MSDN (If...give me a keyword I can search for)
Thank you
|
|
|
|
|
TN020: ID Naming and Numbering Conventions
This note describes the ID naming and numbering conventions used by MFC 2.0 for resources, commands, strings, controls, and child windows.
Don't let the MFC 2.0 scare you, very little has changed...
|
|
|
|
|
Hello,
I need to write an MMC snapin in ATL. I've scanned the MSDN, but the samples are kind of tough. Does anybody know about a beginner tutorial? Or if anybody with experiences in writing MMC snapins can answer me some questions. Would be very helpfull.
Thanks a lot,
Matthias
|
|
|
|
|
Hi all,
I need to pass a function as a parameter of another function, but I don't know how to do it..
Example of what I want to achieve..
int function1 (int x, iny y);
BOOL function2 (int a, int b, function1)
{
return(function1(a,b)>0)
}
Can anyone help..
|
|
|
|
|
A simple example of what you are trying to do can be found in the EnumWindows function.
BOOL EnumWindows(
WNDENUMPROC lpEnumFunc,
LPARAM lParam
);
lpEnumFunc is the function passed in that is of type WNDENUMPROC, which is defined
typedef BOOL (CALLBACK* WNDENUMPROC)(HWND, LPARAM);
An example of a function of this type is
BOOL CALLBACK EnumWindowsProc(
HWND hwnd,
LPARAM lParam
);
So - define
typedef int (CALLBACK* MYFUNCTION)(int, int);
and then
BOOL CALLBACK function1(int x, iny y)
{
);
BOOL function2 (int a, int b, MYFUNCTION lpFunction)
{
return (lpFunction(a,b)>0);
}
BOOL bVar = function2(10,20, function1);
Note that callback functions like function1 must be static member functions, or globals.
Disclaimer: this is all off the top of my head - excuse any mistakes
|
|
|
|
|
Hi,
How can I get all locales which is installed on my computer?
I think that I have to use EnumSystemLocales function, but what further more?
I need quick help...
Thank you beforehand...
Tesic Goran
|
|
|
|
|
I used the CDC::DrawDragRect in the OnMouseMove method and it generates the drag rectangle corectly only when moving from topleft to bottom right and all other directions result in the last rect not being erased ... what should be added for each mouse movement direction so that the drawdragrect functions normaly ?
|
|
|
|
|
It is advised to pass normalized rectangles to DrawDragRect() - call rect.NormalizeRect();
|
|
|
|
|
I'm a novice using VC++6 and speaking and writting english too, so excuse me if I ask something too easy or in an incorrect way.
I would like to print more than one page using MFC, and when I've detected the end of the current page I don't know how to tell VC++ that must begin another one.
Thank you in advance JCpp.
|
|
|
|
|
You must set up CPrintInfo Class. It has a Method
called SetMaxPage that would set up the number of pages you want to print.
Then you can use the following loop to print
CDC dc; // Printer dc obtained from Print Dialog
CPrintInfo info; // Printer info class
For(page=Info.GetMinPage();page
|
|
|
|
|
i've got a very special problem. i created a global variable. the variable contains an array of an other object. that object contains only three pointers to other objects. they are initialized with 0.
the problem is:
the array can't be bigger than 213. why is that, and how can i solve this?
thx
|
|
|
|
|
Hi,
when i create a new document the new child window is shown in its original size; i want to
resize it to its maximum. How can i do that?
My problem is that i don't know how to get access to the new child window.
I have tried to resize all available views in CDocument::OnNewDocument() with ShowWindow(...), but this didn't work.
Any help?
Thanks,
Chris
|
|
|
|
|
|
In CChildFrame::OnCreate() send message WM_SYSCOMMAND with wParam=SC_MAXIMIZE
|
|
|
|