|
hi,
i would like to add a system dsn to the system in the application. i have tried SQLConfigDataSource(). but, it returned "fail" to me.
would anyone give me some insight about this function?
thanks,
jim
|
|
|
|
|
Well, without a code snippet of how you are using the function, a diagnosis would be a guess at best.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Friends,
I need to enable/disable the menu items. For this purpose i am using the EnableMenuItem() function of CMenu class.
The problem is that this function takes input the menu item's ID. But, there are menu items known as "Pop Up Menu Items " having no ID.
How can i enable/disable, popup menu items.
|
|
|
|
|
Hi,
take the parameter MF_BYPOSITION
e.g.
CMenu::EnableMenuItem(2, MF_BYPOSITION | MF_GRAYED);
-> disabled / grayed the third menu item.
Regards
Frank
|
|
|
|
|
thanks for your reply,
I am still having a problem...
In the solution you given, the top menu items are getting disabled. But i want to disable the cascaded menu item.
Example if you have MSN messenger, see the menu item "My Status" from file menu. This is cascaded menu item. How can i disable such menu item.
|
|
|
|
|
You need to know the ID of the first item in the cascaded menu. If you have a UI handler for it, you'll see that it's called twice, first for the menu, then for the option itself.
The trick is to check the CCmdUI object's m_pSubMenu field. This will be null if it's a menu item, and non-null if it's a submenu. In the latter case, you'll need to do something like this;
pCmdUI->m_pMenu->EnableMenuItem(pCmdUI->m_nIndex, MF_BYPOSITION|MF_GRAYED);
to gray it out, as the normal Enable member won't hack it.
This was in the MSDN's C++ Q&A column a while ago
Steve S
|
|
|
|
|
i am using the machine generated Code for the MS Command button (ActiveX).
When developing under WinNT4.0 there was no problem in Setting the Picture Path in the Properties to a BMP File and é voila, the dialog showed up with a bitmap button.
Now i am developing under Win2k, and everytime the dialog with the buttons intialises, the code crashes. Without the Bitmaps it works perfectly. Checking the Source i would manually load the bitmaps to the buttons (hoping that this might work).. i would like to load bitmaps from an Resource ID.
My Problem right now is that it needs an IDispatch*. I guess that i need a CPicture Object (casting it to an IDispatch*), but i can't find any constructor which would take an id, or a CBitmap or sthing like that.
Can anybody help?
Thanks in advance,
Bernhard
"I'm from the South Bronx, and I don't care what you say: those cows look dangerous." U.S. Secretary of State Colin Powell at George Bush's ranch in Texas
|
|
|
|
|
Hi, i followed this link to have a dialog with scrollbars:
http://support.microsoft.com/default.aspx?scid=kb;en-us;262954
This was pretty good .. when you resize it, it will have scrollbars.(Horizontal Scroll & Vertical Scroll)
But this doesn't take away the need of having to scroll already when the dialog is shown. Let's suppose the dialog is too big to fit in the screen, how can i make sure there are already scrollbars on it?
Best regards
Jens
|
|
|
|
|
I'd like to make a desktop resident program, something like a calendar that sits on your desktop that you can click on to add notes or appointments. I've seen them before (in fact i have one that I use) but my biggest problem is that I don't know where to start... Basically, how would I go about creating a window to place on the desktop that doesn't have any titlebar or border? I'd like to make the background transparent such that the month/year text and date text will appear to be directly on the background, and the user can click on any given date to add a note for that day. Eventually I want to add functionality to change the month manually and do re-occuring events etc, but that's down the road. I'd like this to work on at least WindowsXP.
I've successfully made a layered window and made the background transparent (technically everything white is transparent, which includes part of the titlebar), but the titlebar and border are still visible. I don't necessarily need actual code, but I have no idea how to start this off. I've done Win32 and MFC stuff before, but nothing like this. Thanks!
- Allyn
|
|
|
|
|
go th ethe dialog properties->styles
check off the title bar and select border as none
|
|
|
|
|
Sir,
Thanx for giving me such a nice way to interact with u. I am a student & i encountered a problem i m using “Kodak Image Edit ActiveX Control” [WINNT,VC6.0]
i have created a dialog based application to create this control at runtime on click of a button. It will create the control dynamically with image. Sir I want message handler (onLButtonDown, onRButtonDown etc.) on that control at runtime to call the functions of the control class “CImgEdit” like Flip(), SetImageControl() etc.
Instead I have called Flip() function on the message handler onLButtonDown of Dlg class (just 4 trial)now if u click wherever on dialog the image will be flipped .
Moreover, if there are multiple buttons, each creating control dynamically with different images on it, then how the message handlers of each control will be managed separately.
Thanx again for the cooperation
Saadyah Nisar
|
|
|
|
|
Sir,
I am developing a socket program..
i want to transfer a set of files in a particular folder.
i want to transfer the files from server to client and also
i am going to display the filenames in that folder.
so, what function i have to use for that...
can, anybody tell me the solution..
Thanks in advance,
Kuttipa.
|
|
|
|
|
Hi,
U open first a tcp or udp based connection between the server and client.
If ur files are fixed (for transer) U can send them after establishing the connection (using send (tcp) or sendto(udp)). If you want to give the files choice to the User you have to provide a User Interface for selecting the files. You have to write quite a bit of code for all these things. Not possible with a function.
Satya
|
|
|
|
|
Guys i am having a problem using Visual C++ 6 and 7 both.
I create a menu and assign hot key to menu item, like &line, &circle e.t.c, the hotkeys are visible at design time on menu template. But when i run my application, the hot keys are not visible
Similarly, if i generate a SDI application using wizard, and simply Compile and Run it, then at run time the hotkeys of menu items are not visible.
Can anyone tell me what is the problem...
|
|
|
|
|
Press the 'Alt' key and release, then you would be able to see the hot keys.
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
Hello, gurus! I try to hooking TextOutA,TextOutW,ExtTextOutA,ExtTextOutW in a Dialog using Microsoft Detours. And turn the string to uppercase before display it.
It works fine in the client area, such as button control,static control and etc. But the Dialog's caption and menu is still in lowercase. Why?
//dlg.cpp
DETOUR_TRAMPOLINE(BOOL __stdcall Real_TextOutA(HDC a0,
int a1,
int a2,
LPCSTR a3,
int a4),
TextOutA);
BOOL __stdcall Mine_TextOutA(HDC a0,
int a1,
int a2,
LPCSTR a3,
int a4)
{
BOOL rv = 0;
char *p = _strdup(a3);
_strupr(p);
rv = Real_TextOutA(a0, a1, a2, p, a4);
free(p);
return rv;
}
CMyDlg::OnInitDialog()
{
DetourFunctionWithTrampoline((PBYTE)Real_TextOutA,
(PBYTE)Mine_TextOutA);
return CDialog::OnInitDialog();
}
|
|
|
|
|
currently my brush is red in color....and it paints something on background.... now i want to repain the ssame area that i painter red WITH A INVISBLE COLOR...that is i want the user to be able to see the background again....
can ayone tell me how do i get a INVISIBLE COLOR please?????
tks a lot...
|
|
|
|
|
Use the XOR property while painting
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
huh????
how to do that?????wat are u talkin about????
With Regards
Joseph R. Thomas
Have a Super Blessed Day!
-------------------------
For God has not given us a spirit of fear, but of power and of love and of a sound mind.
2 Timothy 1:7
|
|
|
|
|
If you are painting the window using BitBlt( ... ) API, you can probably use the PATINVERT attribute for dwRop value.
See this link
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/bitmaps_0fzo.asp
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
I have designed a board using USB port,and write a driver
under windows XP by WinDriver(JUNGO). I use some test soft-
ware to test it, the software can found the device,but I write a application programe to operate the board, the programe can't find the device.
I will know:
1.How to search a device under windows OS?
2.How to get GUID?
3.can you give me a DEMO? Thank a lot!
|
|
|
|
|
Hi..
I am developing an application program that needs to dynamicially load different application program based on user choice. And i need to dynamically load the application description for the user to choose as well.
My solution :
I have found a way to do so by using a listbox that search through the exe files(Application Executable) and load them into the listbox for selection but i need to get the File Description from the VS_VERSION_INFO resource, anyone knows how to do it. I know there are APIs around but they are meant for getting the versions.
Thank You
|
|
|
|
|
Hi
try this (short form):
<br />
DWORD Size, Tmp;<br />
if (Size = GetFileVersionInfoSize(PathName, &Tmp))<br />
{<br />
char *Info = new char[Size];<br />
if (GetFileVersionInfo(PathName, 0, Size, Info))<br />
{<br />
void *lpBuffer;<br />
UINT dwBytes;<br />
<br />
if (VerQueryValue(Info, TEXT("\\"), &lpBuffer, &dwBytes))<br />
{<br />
VS_FIXEDFILEINFO *lpvsFixedFileInfo = (VS_FIXEDFILEINFO *)lpBuffer; <br />
...<br />
}<br />
}<br />
delete[] Info;<br />
}<br />
HTH
Regards,
Frank
|
|
|
|
|
Just study vc++,ask a very simple question,how to call system command in vc++? thanks in advance!
|
|
|
|
|
system("");
usually works. ie, to do a dir, put in
system("dir");
*.*
cin >> knowledge;
|
|
|
|