|
Not a tutorial, but here is how to connect to a paradox database.
Driver={Microsoft Paradox Driver (*.db)};DBQ=physical path to .db file;DriverID=26
See this web site for other database connections.
msdn.microsoft.com[^]
There are a couple of tutorials here at Code Project. The listing can be found here.
http://codeproject.com/database/#ADO[^]
Hope this helps...
-------------------------------
DEBUGGING : Removing the needles from the haystack.
|
|
|
|
|
thanks for your help i will look at the page !!
nothing
|
|
|
|
|
can someone plz give me a tutorial on how to change a pushbuttons appearance using GDI.
i'd like to do it completely in Win32/SDK also
Thanks In Advance,
Tim Zorn
|
|
|
|
|
Basically, you set the control to be owner drawn, then you draw it however you like.
This[^] article may be of some help.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
thank you for advance i have change my article.
can you help me?
nothing
|
|
|
|
|
What did you want help with ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
this is my code for useing ADO link Paradox DataBase.
but it throw wrong so maybe you can help me.
i will greatly appreciated
BOOL CTM21App::InitInstance()
{
CString connectsource;
_ConnectionPtr pCon;
AfxOleInit();
AfxEnableControlContainer();
pCon.CreateInstance(__uuidof(Connection));
try
{
connectsource.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=%d\\work\TM21Vol4\gentan500\Database;Extended Properties=Paradox 4.81;Persist Security Info=False");
pCon->Open((_bstr_t)connectsource,"","",adModeUnknown);
}
catch(_com_error e)
{
AfxMessageBox("open .db wrong");
return FALSE;
}
}
nothing
|
|
|
|
|
I'm sorry, I'm really not sure. What's the _com_error you catch, have you looked ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
how do u do owner-drawn stuff.
i looked at the article u linked to but i didnt understand much of the source
|
|
|
|
|
An alternative to making a fully owner-drawn button, is to put an icon or bitmap on a standard pushbutton.
From a quick look at some old SDK-level code, the code is something like this:
buttonHwnd = CreateWindow("button", "",<br />
WS_CHILD | WS_VISIBLE | BS_ICON | BS_PUSHBUTTON,<br />
ButtonXPos, ButtonYPos, ButtonWidth, ButtonHeight,<br />
hwndMain, (HMENU)buttonId, hAppInst, NULL);
hButtonIcon = LoadIcon(hAppInst, MAKEINTRESOURCE(IDI_ButtonIcon));
SendMessage(buttonHwnd , BM_SETIMAGE, (WPARAM)IMAGE_ICON,<br />
(LPARAM)(HANDLE)hButtonIcon);
Right at the moment I forget what all the parameters are, but if you need help, just ask.
|
|
|
|
|
thanks a bunch man. but how do u get it to have text along with an image.
also how do i get the image to stretch across the whole button
|
|
|
|
|
I put bitmaps and icons on the buttons, but the basis was standard Windows pushbuttons. I don't have time to check now, but I think I made the size of the icons / bitmap such that they neatly fitted onto the flat grey foreground of the button. I can't remember what happens if the bitmap or icon is too big for the foreground. I would guess that if the bitmap if too big, you loose the 3D "animation" effect at the edges of the button.
To have text with an image, maybe just include the text in your bitmap / icon.
I will try to have a look at what I did later today (I'm on a course for the next 9 hours.)
|
|
|
|
|
Sorry - I had a quick look, but the earliest version I have on my work PC uses Icons on buttons (that version uses the code I posted previously.)
If it is any use to you, I am sure I can find a backup disk at home with a version which puts bitmaps on buttons. Let me know if I must find it! (Or any other similar questions.)
|
|
|
|
|
i know how to put bitmaps on buttons now but i dont know how to do it the way i want.
i want a bitmap to be stretched across the button and i want to be able to put text on the button. i have found an article that does it but i dont understand the source so im asking for help.
For Example:
a program called ICQ is skinned so it has custom buttons. but when i look at it's resourses the buttons are not ownerdrawn. all i want to do is make a custom button that has text on it. i dont even need the handling for if its selected, default, etc cuz i can find that out myself
help would be appriciated
thx
|
|
|
|
|
hello people
I would like to ask for help for the next problem:
(please take a look a this image) http://xwega.com/images/menu.jpg[^]
the problem is this:
the menu bar has the same code base as the Toolbar, in fact the menubar is a toolbar with the TBSTYLE_LIST style.
the toolbar works great but the menubar as some problems sending the TBN_HOTITEMCHANGE notification.
the menu bar is loadded like this:
m_Menu.LoadMenu(nResource);<br />
<br />
SetButtons(NULL,m_Menu.GetMenuItemCount());<br />
<br />
for(UINT i=0 ; i<m_Menu.GetMenuItemCount() ; i++)<br />
{<br />
CString menuText;<br />
m_Menu.GetMenuString(i,menuText,MF_BYPOSITION);<br />
GetToolBarCtrl().AddStrings(menuText);<br />
<br />
SetButtonText(i,menuText);<br />
SetButtonInfo(i,i,TBSTYLE_FLAT | TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE | TBBS_NOPREFIX,0);<br />
}
top menu item dont have an ID so place the variable "i" as the ID of the buttons,
and this is the problem
this way the notification is not sent and i do not know when the mouse leave the menubar
however , if the ID is set as -1 it works great but then i have now way of knowing in what button the mouse stands.
any ideias?
thanks
|
|
|
|
|
First of all is this possible?
I get several regions from set of paths. I would like to do a bollean operation on them and store have a path that would contain my final region after boolean operation. I am doing this is GDI+.
Thanks in advance,
Sincerely,
Max Pastchenko
|
|
|
|
|
I am guessing no then.
Sincerely,
Max Pastchenko
|
|
|
|
|
I have a Win32 application that, for reasons that are beyond the point I'm raising here, needs to execute a Win16 application. The Win16 EXE is copied to the TEMP folder and run from there.
The program (the Win32 one, that is) first determines the TEMP folder with GetTempPath(). In a lot of cases, I get something like C:\Documents and Settings\[profile]\Local Settings\Temp.
CreateProcess() fails if I specify a Win16 name if the EXE is in a path that doesn't respect the old 8.3 rules. To work around this "problem", I call GetShortPathName() to have the TEMP path converted to C:\DOCUME~1\[profile]\LOCALS~1\TEMP, to which I append the EXE name and call CreateProcess() -- this works.
Here's one problem:
I have a customer who runs the Win32 application (on XP SP2), which copies the EXE to the appropriate TEMP folder (I've confirmed this). Then he gets an OS dialog box (NOT generated by my program) with a caption saying "Can't run 16-bit Windows program" and the message saying "Cannot find file C:\DOCUME~1\[profile]\Local Settings\Temp\MYAPP.EXE".
Notice the "Local Settings" part--that, somehow, didn't get translated, and CreateProcess() fails.
I can't reproduce this problem on my end--when I call GetShortPathName(), every part of the path correctly gets converted to 8.3 format. If I hardcode the FUBARed path in a test program ("C:\DOCUME~1\[profile]\Local Settings\Temp"), then CreateProcess() fails (returns FALSE), but I CANNOT, under any circumstances, get the OS to display that dialog box.
I've also confirmed with the customer that re-pointing the TEMP variable to something like C:\TEMP fixes the problem.
- Has anyone ever seen GetShortPathName() fail in this fashion?
- If I can't rely on that API to return a correct path, what can I use (*RELIABLY*) as a temporary folder? My users have mixed OS environments, from Win95 to 2003, with different users having different permissions on different drives--some have a totally locked down system and I can't even temporarily create my own folder and delete it later. In essence, *where* am I guaranteed to be able to temporarily write files to and then delete files from, if I can't rely on %TEMP%?
Hints appreciated...or better yet, a KB article that shows Microsoft acknowledging this as a problem addressed with a hotfix I can show to the customer...
|
|
|
|
|
Daniel Desormeaux wrote:
Then he gets an OS dialog box (NOT generated by my program) with a caption saying "Can't run 16-bit Windows program" and the message saying "Cannot find file C:\DOCUME~1\[profile]\Local Settings\Temp\MYAPP.EXE".
So does this imply that GetShortPathName() succeeded in shortening the path to C:\DOCUME~1\[profile]\LOCALS~1\TEMP but that CreateProcess() has interpreted it as C:\DOCUME~1\[profile]\Local Settings\Temp instead? If, however, GetShortPathName() is failing, what does GetLastError() return?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
I'm not entirely certain at this point, but I would have to wonder why CreateProcess() would take an 8.3 path and interpret it differently. There is currently no check for the value returned by GetShortPathName() (bad, I know), so I'll have to send the customer a special build to have it logged.
Graham's suggestion (that the NtfsDisable8dot3 registry setting might be disabled) is an interesting one, although if that was the case, I wouldn't expect the "Documents and Settings" part to get converted to DOCUME~1 (it was)...
|
|
|
|
|
Daniel Desormeaux wrote:
I'm not entirely certain at this point...
Ok, if it is then you know the problem is not with GetShortPathName() .
That still leaves an oddity with CreateProcess() . Have you ruled out AV software getting in the way?
Also, is MSDN article Q198429 of any help?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
> Ok, if it is then you know the problem is not with GetShortPathName().
Actually, if GetShortPathName() failed, I wouldn't expect the output buffer to contain anything at all upon return, which isn't the case. I know that's an assumption, but still...
In any case, after further investigation, it looks like Graham's hint was right on the money. If I prevent the OS from creating 8.3 names, then any folder created *after* changing the registry value (and rebooting) will *not* get translated by GetShortPathName() (eg, "Local Settings" will be returned as just that, and not LOCALS~1).
Even with Explorer itself--if I copy a 16-bit EXE into a folder that doesn't have an 8.3 equivalent, and then double-click the EXE, Windows displays a message saying it can't find the file...
Next step is to ask the customer if he's messed with that registry value (predeployed disk image, SYSPREP tool, etc)...
|
|
|
|
|
[Wild Guess]
The customer has the NtfsDisable8dot3 registry setting enabled?
[/Wild Guess]
|
|
|
|
|
I found a very useful guide to Windows programming from the ground up here. I followed it pretty closely, changing around a little bit by functionizing the initialization. The problem is when I run my app, it consumes all CPU power but I don't have it doing anything when the window pops up, just a window with a menu on top. Can someone go through that page and tell me if I or he missed something to create this problem? Thanks in advance.
|
|
|
|
|
Without seeing what code you actually put in place, it's kind of hard to say what might be wrong.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|