|
Anyone knows how to disable edit boxes w/in your program? Thx
ralf.riedel@usm.edu
|
|
|
|
|
MyEdit.EnableWindow(FALSE);
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
or GetDialogItem ( THE_EDIT_ID )->EnableWindow( value );
value = TRUE --> ENABLE
value = FALSE --> DISABLE
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
I would use
m_Edit.ModifyStyle(0, ES_READONLY) ;
This would allow the ocntent to still be copied to the clipboard by the user, but not change it.
Roger Allen
Sonork 100.10016
I think I need a new quote, I am on the prowl, so look out for a soft cute furry looking animal, which is really a Hippo in disguise. Its probably me.
|
|
|
|
|
I have a VB activeX dll. How does one call this from an MFC application?
Thanks,
ns
|
|
|
|
|
Try to import the methods of dll. For that try to make a new class from the dll....
I never tried that but you can try to do...
Best Regards....
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
http://www.codeproject.com/dll/vbactivexwithvc.asp
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
That looks like an excellent lead. Thanks so very much!
ns
|
|
|
|
|
http://www.codeproject.com/com/vbeventswithvc.asp good also
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
u can try in MSDN with this question number:"Q194873"
The article name is:
"HOWTO: Access a Visual Basic ActiveX DLL from Visual C++"
In this article he explained three different ways to call
vb activex dll from vc++
enjoy....
anju
|
|
|
|
|
Hello,
When using hotlinks for URL's in a Richedit Control, and then calling ShellExecute as follows:
<br />
ShellExecute(hWnd, NULL, pszURL, NULL, NULL, SW_SHOWNORMAL);<br />
The memory footprint of my executable will go up about 2 1/2 megs. Is there a way to free this memory up after a URL is clicked, or am I implementing something wrong here?
Thanks!
. djrisc .
|
|
|
|
|
I suggest you change the first parameter of ShellExecute from "hWnd" to "NULL".
|
|
|
|
|
Thanks for the suggestion.
Unfortunately the memory footprint still goes up with the first parameter set to NULL.
. djrisc .
|
|
|
|
|
I suspect because it has to load a dll (shell32.dll I think). This would not really expand your memory footprint since the memory of the dll is typically shared between all programs. If your using the task manager to view the memory footprint, you have to take what it says with a grain of salt.
Joel Lucsy (jjlucsy@ameritech.net)
|
|
|
|
|
Hi, All,
How can I select item in a ListCtrl programmatically? the ListCtrl is in
Report View mode.
Thanks in advance
|
|
|
|
|
Use this...
SetItemState(index, LVIS_SELECTED, LVIS_SELECTED);
... or even this:
SetItemState(index, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
Tomasz Sowinski -- http://www.shooltz.com
Free your mind and your ass will follow.
|
|
|
|
|
|
SetItemState (idx, LVIS_SELECTED, LVIS_SELECTED);
For men use, if they have an evil turn, to write it in marble:
and whoso doth us a good turn we write it in dust.
-- Sir Thomas More
|
|
|
|
|
|
hi all..
I have win32 console application w/o MFC support..
then I " include <afx.h> " in my header file for CString..
and I declare " CString msg; " in my cpp file. Then I run and got following link errors even without setting any value to "msg" yet.
Compiling...<br />
test.cpp<br />
Linking...<br />
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex<br />
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex<br />
Debug/test.exe : fatal error LNK1120: 2 unresolved externals<br />
Error executing link.exe.<br />
<br />
test.exe - 3 error(s), 0 warning(s)<br />
the reason why i want to use CString my cpp file is to format long, and double variable as a string..
<br />
long letter_count,legal_count,tabloid_count,sqft_count;<br />
.<br />
.<br />
.<br />
msg.Format("\nLetter Size:%d\nLegal Size:%d\nTabloid Size:%d\nOverSize:%f\n",letter_count,legal_count,tabloid_count,sqft_count);<br />
<br />
|
|
|
|
|
Switch to multithreaded C runtime in project settings.
Win wrote:
the reason why i want to use CString my cpp file is to format long, and double variable as a string..
sprintf doesn't work?
Tomasz Sowinski -- http://www.shooltz.com
Free your mind and your ass will follow.
|
|
|
|
|
(This does not collide with Thomas' wise advice about the run-time ibrary version you sohuld be using.)
Using CString in an app without MFC is IMHO a bad idea, even if you succeed in your endeavor. For the purposes of formatting, sprintf works pretty much the same as CString::Format (only caveat is you've got to preallocate a buffer large enough to accomodate the result).
If you need a powerful string class with similar functionalities as CString , you can use std::string s.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
You do not have to use CString just for formatiing. You can use just sprintf. That way you will not have to include any MFC related files at all.
Prashant
|
|
|
|
|
just use sprintf on a character array.
char buf[100];
snprintf(buf, 100, "\nLetter Size:%d\nLegal Size:%d\nTabloid Size:%d\nOverSize:%f\n",letter_count,legal_count,tabloid_count,sqft_count);
-c
For men use, if they have an evil turn, to write it in marble:
and whoso doth us a good turn we write it in dust.
-- Sir Thomas More
|
|
|
|
|
Well, why don't you use WTL? It supports CString .. this is much easier than trying to use MFC's CString
(a.k.a. Wal2k) www.wal2k.com
|
|
|
|