|
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))
...
}
|
|
|
|
|
Hello,
I'm writing an application that uses MFC.
It is a kind of media player and I use CListCtrl to display playlist.
But I get a strange error when I add items to my list control. After the 17th item added, my app crashs with a message box showing "Invalid Hook Descriptor".
I am attaching some code. To keep it simple, I've just extracted parts liable to contain the bad code : the overrided Create member method and the UpdateList method.
An explanation : I'm displaying playlist. So I read the M3U file and I call Update list method to add the file paths to the CListCtrl.
Any help would be appreciated. That bug is driving me crazy.
Thanks
bool CMusicBox::CreateWnd(CWnd* Parent)<br />
{<br />
parent = Parent;<br />
if(parent)<br />
{<br />
<br />
RECT client;<br />
parent->GetClientRect(&client);<br />
int result = this->Create(WS_CHILD|WS_VSCROLL|WS_BORDER|WS_VISIBLE|LVS_SHOWSELALWAYS|LVS_REPORT|LVS_ALIGNLEFT,client,parent,1234);<br />
this->SetExtendedStyle(0x00004000|0x00000100|0x00000020|0x00000010);<br />
<br />
this->SetBkColor(RGB(237,242,249));<br />
}<br />
The UpdateList method
void CMusicBox::UpdateList(void)<br />
{<br />
this->DeleteAllItems();<br />
ASSERT(this->GetItemCount() == 0);<br />
int max = this->play.playList.GetCount();<br />
<br />
this->SetItemCount(max);<br />
<br />
int i = 0;<br />
<br />
for(i = 0;i<max;i++)<br />
{<br />
CFile myFile;<br />
<br />
CString title;
CString path;<br />
unsigned long siz = 0;<br />
<br />
if(myFile.Open(this->play.GetSong(i),CFile::modeRead|CFile::shareDenyNone))<br />
{<br />
title = myFile.GetFileTitle();<br />
siz = myFile.GetLength();<br />
myFile.Close();<br />
}<br />
else {<br />
title.Format("Access Denied");<br />
}<br />
HMS dure = {0,0,0};<br />
<br />
path = CString(this->play.GetSong(i));<br />
<br />
HWND tester = MCIWndCreate(NULL,AfxGetInstanceHandle(),WS_BORDER|MCIWNDF_NOERRORDLG,path.GetString());<br />
if(tester)<br />
{<br />
long len = MCIWndGetLength(tester);<br />
dure = GetHMSTime(len);<br />
MCIWndDestroy(tester);<br />
}<br />
<br />
char *taille = new char[50];<br />
char *duree = new char[50];<br />
char *chemin = new char[MAX_PATH];<br />
char *titre = new char[MAX_PATH];<br />
<br />
sprintf(taille,"%.2f",siz/(1024.0*1024));<br />
if(dure.h == 0) <br />
sprintf(duree,"%d : %02d", dure.m, dure.s);<br />
else sprintf(duree,"%d : %02d : %02d",dure.h, dure.m, dure.s);<br />
strcpy(chemin, path.GetString() );<br />
<br />
CPath filePath(path);<br />
<br />
sprintf(titre,"%s",filePath.GetTitle());<br />
<br />
LVITEM lvi;<br />
<br />
ZeroMemory(&lvi,sizeof(LVITEM));<br />
<br />
lvi.mask = LVIF_TEXT;<br />
<br />
this->InsertItem(i,"item");<br />
<br />
this->SetItem(i,0,LVIF_TEXT,titre,NULL,NULL,NULL,NULL);<br />
this->SetItem(i,1,LVIF_TEXT,duree,NULL,NULL,NULL,NULL);<br />
this->SetItem(i,2,LVIF_TEXT,chemin,NULL,NULL,NULL,NULL);<br />
this->SetItem(i,3,LVIF_TEXT,taille,NULL,NULL,NULL,NULL);<br />
<br />
<br />
}<br />
}<br />
-- modified at 21:05 Saturday 29th October, 2005
|
|
|
|
|
hi,
beginner question: how would I implement a "number picker" control where there is an up/down button (like from a vertical scrollbar) and as you click up the number increments by one, down decrements by one until it hits zero, then when I hit ok it gives me the number I chose. Thanks!
|
|
|
|
|