|
What is the easiest way for changing CButton (MFC) text control??
Please help
|
|
|
|
|
the only way i know of is to use CreateFont
|
|
|
|
|
can do it by using CWnd::OnCtlColor. Have a look @ the MFC Library Reference @ msdn
|
|
|
|
|
Hi guys,
Can anybody give me any pointers on how to make an mfc/C++ application upgradable? I've written the app, created a setup project, and am about to distribute it. But if in two months time i want to release an upgrade to my program, what should I do?
I have absolutely no idea how upgrades work, or what I have to do to make my application upgradable.
I'd be grateful for any general guidelines or principles about what I should do. I don't need any sample code or anything, just general suggestions about the approaches I might take.
Thanks for your help. i realise this thread is a bit vague, I can provide more information about my app if anybody requests it.
Mick
|
|
|
|
|
Well, you can distribute a new exe, or make a patch that updates the old one. Or load the functionality that you might update from dlls, and update those
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Thanks Christian. I realize that just replacing the old exe with a new one is the easiest option, but this is not as elegant as distributing an upgrade that is nice and small, and only replaces the bits of the program that are out of date. So I guess I would like to make "a patch that updates the old one". But how do I do that? Once I have compiled my exe, surely I can't change anything in its code?
Thanks for replying!
Mick
|
|
|
|
|
Oh right, so I think I understand. I have to compile each class as a dll, then replace the dlls that are being upgraded, leaving the remainder as they are?
Mick
|
|
|
|
|
You can do that, choosing just the classes that you're likely to change. Or you can use a tool which basically diffs the two exes ( old and new ) and then makes a program which takes the differences, and merges them into the existing ( old ) app on the client machine.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
In MS Studio VC++ 6.0, I want use the following code to get Local PC IP Address, However IPString is always returned as "0.0.0.0" why???
Thanks for any suggestion.
void CDispipDlg::OnButton1()
{
// TODO: Add your control notification handler code here
CMySocket pp;
CString IPString;
UINT nPort;
pp.Create();
if(pp.GetSockName(IPString,nPort))
{
AfxMessageBox(IPString);
}
else
{
AfxMessageBox("Got an Error");
}
}
|
|
|
|
|
Hi again, I have another problem.
I'm creating a test COM server to learn more about the COM interface.
Now I tried to call call the server via C, and everything works fine.
But when I'm trying to call the server using VBScript then always the same error occurs:
800A01A8 - Object required
The script looks like this:
Dim t
Set t = CreateObject( "atlcom.TestInterface" ) (the interface gets loaded here, I used OutputDebugString to make that sure!)
t.MsgBox "Test" <- this is the error line.
I don't know what is wrong.
Do you have any ideas?
Don't try it, just do it!
|
|
|
|
|
[edit]And why was this post awarded a 1? Did I hurt anybody's feelings or what? [/edit]
VBScript can only handle IDispatch-based COM objects.
BTW, this isn't the best forum for COM questions..
--
Arigato gozaimashita!
|
|
|
|
|
ah thanks, didn't know that!!
Don't try it, just do it!
|
|
|
|
|
|
Hi
I'm trying to design a control, derrived from CStatic with keyboard navigation support. When user press the Tab button I call GetNextDlgTabItem and then SetFocus, but, for example, if the next control in tab order is button it draws inproperly - the focus rect is drawn, but the button does not look as default.
|
|
|
|
|
Hi all, I'm kinda new to C++ and I'm using it to try and understand object orientated programming.
I've got a few classes written which I have copied from a book and stripped down to the bare minimum so I can try and see what is going on. Basically I have 3 classes ( TruckLoad, Box and List ). As far as I understand it List is a aggregation of the Box class so that multiple instances of the Box class can be stored ( container class - I think ). TruckLoad is a class which contains a list of the box objects. So the dimensions of each box are stored in each instance of the box object which is stored in the TruckLoad list.
I am trying to store a list of characters instead of a list of numbers. I tried changing all the 'double' declarations to 'char' but a number of errors were produced. If I wanted to store a list of characters instead of a list of numbers how would I do this? For example when the program is run it produces:
The largest box in the first list is 100 by 100 by 100
Press any key to continue
What I am asking if I wanted to produce the following how would I do it?
The largest box in the first list is one hundred by one hundred by one hundred
Press any key to continue
If you want to take a look at the classes I've put together, you can download all the entire project files here:
www.hostmaster-x.co.uk/c++/
Thank you in advance.
CaptainChainsaw
|
|
|
|
|
I have a dialog in a DLL that I need to set to the system tray. Is that possible and if o how can I do that?
|
|
|
|
|
You mean real dialogs? Like quicklaunch bar?
Don't try it, just do it!
|
|
|
|
|
Yes a real dialog.
I have a dialog window in my DLL file and I want to send that dialog do the system tray is that possible?
|
|
|
|
|
Do you want a tray icon which activates a dialog on click, or a deskband? It's not clear what you mean.
--
Arigato gozaimashita!
|
|
|
|
|
For your information guys ,
Quick launch bar is not in system tray , it is on taskbar. System tray is the area where system time is displayed.
You need to add just one icon there and your application will get notified when user clicks/dblclicks on that icon. Then you can display a dialog box.
See Win32 API called Shell_NotifyIcon in MSDN for more help.
|
|
|
|
|
Here's an article[^] that covers this. Try using the search function (available on every page of Code Project) using "system tray" (including the quotes) as the search phrase.
Software Zen: delete this;
|
|
|
|
|
Is there a way to capture the pressing of a KB key in a CDialog item? The usual handler (ON_WM_KEYDOWN) don't work at all. Thanks!
|
|
|
|
|
By default, most keypresses within a dialog are going to be processed by the control within the dialog that has the focus. For example, if you've got a check box, an edit control, and a button within the dialog, one of those controls will process keypresses if they've got the focus.
Software Zen: delete this;
|
|
|
|
|
Yes, I know that but I thought that there's a direct way. I don't know how to send the message from the control to the dialog. I tried with SendMessage() (in OnKeyDown() of my control) but I'm not sure for the way to refer to the dialog and the right set of parameters. Could you give me some example? Thanks in advance!
|
|
|
|
|
Hi everyone, I have a problem with linking COM interface and class ids from my own COM server dll.
The class is called CLSID_TestInterface.
It is declared in a machine generated header file called atlcom.h:
EXTERN_C const CLSID CLSID_TestInterface;
The definition is (also machine generated .c file):
MIDL_DEFINE_GUID(CLSID, CLSID_TestInterface,0x50DC50D4,0xAE1E,0x4B05,0x84,0x99,0xF2,0xFE,0x2F,0xEF,0xA8,0xD2);
When I include atlcom.h in the client app and use the class id for CoCreateInstance then there will be this linker problem:
... unresolved external symbol _CLSID_TestInterface ...
My question is:
Where does the compiler get the class id of a client server dll from? / What am I doing wrong?
Don't try it, just do it!
|
|
|
|