|
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;
|
|
|
|
|
This is probably a very basic question, so bear with me
I'm writing a console program and need to use asynchronous sockets. I wish to use WSAAsynchSelect(). The second parameter is a HWND to the window you want to handle the messages. The third parameter is the message you want handled. The events are specified in the fourth parameter. What I thought I could do was use a message loop, like
while( bRet = GetMessage( &msg, NULL, 0, 0 ) != 0 )
{
if( bRet == -1 )
{
// handle
}
TranslateMessage( &msg );
DispatchMessage( &msg );
}
and have the WinProc handle the message specified in WSAAsynchSelect().
The problem I'm having is that I get an "Invalid Argument" error (runtime) when WSAAsynchSelect() is called and I think it's because I'm sending a NULL instead of a valid HWND.
My question is, does anyone know have advice how to use WSAAsynchSelect() in a console application?
Thanks!
mweiss
|
|
|
|
|
I guess you need to create some window to receive the messages - even in console app you can create windows - best choice will be some invisible - message only window (parent is HWND_MESSAGE ). Then you'll have all - valid HWND , valid MsgProc for that window etc.
Hope this helps
|
|
|
|
|
Thanks for the reply.
I found a way to do it without using the windows. I use WSAEventSelect(), WSAWaitForMultipleEvents() and WSAEnumNetworkEvents(). I set up the events in the main thread and in a worker thread wait for events to occur, check which event it was and handle it. I haven't tested it yet, tho.
Thanks.
melinda
|
|
|
|
|
Yes, that's the better method, but you stated that you wish to use the before method, and I prefer to respect ppl. wishes
Anyway, this is much better what you do now, the messaging part (window) is useful only when you have to handle the winsock 1.
Only disadvantage is that you have two threads - mean the whole design is more complicated due to resource locking etc. I usualy trying to design it that it uses only one thread for all that tasks. But it really depends on the application, so there cannot be a general advice except that I said.
wish you good luck!
|
|
|
|
|
I need help with a few more programs please help me.
Thank you Neville Franks and DougwW48 for help earlier, I appreciate it. Please help me one more time.
I tried these and they start like this one:
#include "conio.h"
#include "stdio.h"
void main ()
{
getch();
}
The questions are:
compile a program that will ask the user for an amount in cents ($1.23 = 123 cents). It should then display the number of quarters, dimes, nickels, and pennies equal to the amount.
compile a program that will ask the user for their age. If the age entered is greater than or equal to 18, the program should display that the user is old enough to vote. Otherwise, the program should tell how many years until the user can vote.
compile a program that will ask the user for two floating point numbers. The second number asked for should be the percentage the user wants to find of the first number. It should then display the result of finding the percentage in this format:
Example:
Enter a number: 25
What percent of 25 would you like to find? 3
3% of 25 is 0.75
Thanks a lot for the help.
I get so close on these but can't seem to get them working, i always get 1 or 2 errors. Thanks
|
|
|
|
|
i think you should post you program...what you have done till now... and ask ppl to rectify your errors rather than asking the questions and make ppl do your homework for you...
it will do you good..
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
|
|
|
|