|
Of course I have an include-guard in all my headers.
BTW:
Is there a difference between
<br />
#pragma once<br />
...
and
<br />
#ifnded XY_INCLUDED<br />
#define XY_INCLUDED<br />
...
#endif<br />
or is it just a MS-shorthand for this?
Thanks anyway for your additional hints.
Christof
|
|
|
|
|
I do not know for certain.
It is my suspicion that the #pragma once will cause the file to be added to a table that it has already been processed, whereas the #ifndef does not necessarily preclude reparsing of the entire header, as one does not necessarily include or preclude the entire file within the confines of an #ifndef/#endif set.
The #pragma once , however, seems to imply, "hey, once you read this file for this compilation unit, don't bother reading it again". I favor adding the #pragma once if I now a header would never require reparsing within a single compilation unit. I prefer to create headers that do not depend upon such reparsing activity.
|
|
|
|
|
Christof Schardt wrote: On PC this doesn't seem to be a serious topic (I wonder why).
I used a RAM disk exhaustively back with MS-DOS and Windows 3.x. It was a real time saver for compilations.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
hi all
ive made an activex control (button) but i dont know how to insert it into another application window. but i don know how?
|
|
|
|
|
Can someone give me an advice?
I use mciSendString() (a c++ .dll)
how can came back from fullscreen to windowed mode?
|
|
|
|
|
Hello everybody.I am new in this forum.I would like to know how to connect to an SQL server 2000 database by using C++ using ODBC. I have found a way of connecting to the database by using the AppWizard but i want to know if there is another way also.
The second question i would like to ask is how to connect to an ODBC sql server 2000 database by using the C language and not C++.
I would be grateful to anyone who can help me.
Thank you.
A.K.Silot
|
|
|
|
|
It's very simple just try to find in the books, e.g Kruglinski.
Get the spirit if tomorrow
|
|
|
|
|
First you'll need to create a DSN. Check out Administrative Tools --> Data Sources (ODBC). Then your code can use that DSN to communicate with the database.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
-I have gotten the handle "HWND" of the window then how can i get it name ?
-Are there any way to get all the name of all process are running on te computer?
|
|
|
|
|
You use this:
int nLen = ::GetWindowTextLength(hWnd);
TCHAR *tszWindowName = new TCHAR[nLen + 1];
::GetWindowText(hWnd, tszWindowName, nLen + 1);
Now tszWindowName contains the name of the window. Don't forget to delete []tszWindowName; it when you no longer need it.
For enumerating all process names, have a look at this article:
http://www.codeproject.com/threads/processes.asp[^]
Best regards
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
-- modified at 8:47 Sunday 30th October, 2005
|
|
|
|
|
I am currently working to create the windows calender in visual C++. So is there anyone who can send me either source code or explanation that how could I create it. Will waite, okay bye
Don't have time to create signature
|
|
|
|
|
Hi,
If you are using MFC, why not to use CMonthCalCtrl .
If not, take a look at Manth Calendar control in MSDN;
for example, make a search for MonthCal_SetToday function.
--
======
Arman
|
|
|
|
|
Not a Icon on a pane and a string on another pane.
I mean on the same pane with the icon on the left and the string on the right.
Thank you
|
|
|
|
|
Yes, this is possible.
You need to use the CStatusBarCtrl::SetIcon method which sets the icon for a pane in a status bar.
If you are using the Prof-UIS CExtStatusControlBar class, then you can use the following code:
<code>bool bRet = m_wndStatusBar.AddPane( IDS_PANE_TEXT, 1 );
if( !bRet )
return;
int nIndex = m_wndStatusBar.CommandToIndex( IDS_PANE_TEXT );
m_wndStatusBar.SetPaneWidth( nIndex, 100 );
HICON hPaneIcon = NULL;
HINSTANCE hInstResource =
AfxFindResourceHandle(
MAKEINTRESOURCE( IDR_PANE_ICON ),
RT_GROUP_ICON
);
ASSERT( hInstResource != NULL );
if( hInstResource != NULL )
{
hPaneIcon = (HICON)
::LoadImage(
hInstResource,
MAKEINTRESOURCE( IDR_PANE_ICON ),
IMAGE_ICON,
16,
16,
0
);
ASSERT( hPaneIcon != NULL );
}
m_wndStatusBar.GetStatusBarCtrl().SetIcon(
nIndex,
hPaneIcon
);
IDR_PANE_ICON is a resource identifier of the icon.
Best regards,
Dmitriy Yakovlev
|
|
|
|
|
i was not sure whether to post this in this forum or the xml page but i hope someone can help me.
my problem is that when i try to include an xml file to my code i get a syntax error '<' from the line "< ?xml version="1.0" encoding="utf-8" ? >" but that code has to be there just like that doesnt it? i cannot figure out why it is giving me this error.
any help would be greatly appreciated.
Thank You
- Kyle
-- modified at 1:40 Sunday 30th October, 2005
|
|
|
|
|
gr8coaster329 wrote: ?xml version="1.0" encoding="utf-8" ? >
Hi
I think you most change "< ?" to "<?" , you have an space between < and ? , ? and >
<? xml version="1.0" encoding="utf-8" ?>
Iman Ghasrfakhri
-- modified at 1:26 Sunday 30th October, 2005
|
|
|
|
|
I do have it like that. i just posted it wrong. sorry about that.
- Kyle
-- modified at 13:13 Sunday 30th October, 2005
|
|
|
|
|
How and where are you including this XML file?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: How and where are you including this XML file?
i am including it with #include "file.xml" at the top of my code.
is that wrong?
- Kyle
|
|
|
|
|
gr8coaster329 wrote: is that wrong?
Very much so. You can, however, include it as a resource in the project's .rc file.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
I have a form. I can convert that form to a bmp and
print user data and the bitmap together so that data prints
on top of the bitmap. The problem is, bitmaps print
extremely slowly (and their really big).
Any ideas on how to print the data on top of an
image quicker without programmatically recreating the
form?
Please, any response any one can give me will be
greatly appreciated.
Sincerely,
Danielle Brina (an overworked graduate student)
|
|
|
|
|
Is your app an MFC app ? If so, did you create it with support for printing ? You could create a new app with printing support to see the code you'd need to add to your app.
Alternatively, there are a number of good articles on C++ printing, with and without MFC, in the C++ section.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
> Is your app an MFC app ?
I havent created the final app yet. In the end, I hope its in
MFC.
> If so, did you create it with support for printing ? You could
> create a new app with printing support to see the code you'd need
> to add to your app.
I setup a smaller program that uses the Printing Class Library
that Richard Stringer posted. In that code, I can print a bitmap
and text together and it prints nicely. I can prompt user data
and then have that overlay the bitmap.
However, the bigger and more complicated the bitmap, the slower it
takes to print and I need big (lots of pixels) bitmaps to include
all the detail of the form. I cant figure out how to change
Stringer's printing class library to print some other image format like a tiff. If I could modify that code to print a tiff (and a
bitmap) that could overlay text, then it might print faster and
Id be happy.
If you have any ideas, please dont hesistate to email me.
Sincerely,
Danielle Brina (an overworked graduate student)
|
|
|
|
|
DanYELL wrote: I havent created the final app yet. In the end, I hope its in
MFC.
OK, when you create your app, you can choose printing support from the wizard, this gives you the framework you need to do printing, and there's heaps of info online about using it.
DanYELL wrote: However, the bigger and more complicated the bitmap, the slower it
takes to print and I need big (lots of pixels) bitmaps to include
all the detail of the form. I cant figure out how to change
Stringer's printing class library to print some other image format like a tiff. If I could modify that code to print a tiff (and a
bitmap) that could overlay text, then it might print faster and
Id be happy.
Some printers will let you send a tiff, but I don't know how many. If you want to draw on the bitmap, then it needs to be a bmp in memory. I really don't know how to stream a tiff to a printer, although obviously the first step would be reading it as a byte stream.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Anybody knows how to get SPDRP_FRIENDLYNAME in SetupDiGetDeviceRegistryProperty from USB disk, the buffer I get always invalid?In addition Can It works under Win98?
DEFINE_GUID(GUID_CLASS_USB_DEVICE,
0xA5DCBF10, 0x6530, 0x11D2, 0x90, 0x1F, 0x00, 0xC0, 0x4F, 0xB9, 0x51, 0xED);
hDevInfo = SetupDiGetClassDevs((LPGUID)&GUID_CLASS_USB_DEVICE,
0, 0, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);
if (hDevInfo == INVALID_HANDLE_VALUE)
return false;
DeviceInfoData.cbSize = sizeof(SP_DEVINFO_DATA);
for (i = 0 ; SetupDiEnumDeviceInfo(hDevInfo, i, &DeviceInfoData) ; i++)
{
DWORD DataT;
LPTSTR buffer = new char[1024];
DWORD buffersize = 1024;
SetupDiEnumDeviceInterfaces (hDevInfo, 0, &DeviceInfoData.ClassGuid, i, &DInfoData);
while (!SetupDiGetDeviceRegistryProperty(hDevInfo, &DeviceInfoData,
SPDRP_FRIENDLYNAME, &DataT, (PBYTE)buffer, buffersize, &buffersize))
...
}
|
|
|
|