|
i want that when the aplication star one of the 5 radio buttons is set active as default, because in my program all radio buttons are set as inactive you have to set it qhen you star the program.
|
|
|
|
|
The easiest and most reliable way is to create a CButton member variable for each. Then in the dialog's OnInitDialog() method, call the SetCheck(BST_CHECKED) method of the button you want checked.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
It doesnt work
error C2065: 'SetCheck' : undeclared identifier
|
|
|
|
|
Is this an MFC application?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Yes it is .
Appwizard with mfc
|
|
|
|
|
Then SetCheck() should be available as it is a CButton method. Please provide a code snippet of all relevant pieces.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
You can simply use the CheckRadioButton(..) function.
EXAPMLE :
if you have 5 radio buttons and want to check the 'third' radio button then add this function to yourdialogs OnInitDialog() method
CheckRadioButton(IDC_RADIO1,IDC_RADIO5,IDC_RADIO3);
m0n0
|
|
|
|
|
The way I did it:
I have set a control variable (I'm not sure if this is the right terminology for it). For example, in my app (LNP) I have a list of frequencies that a user may choose using a radio button. I have declared an int m_Freq . Then, I tell it to associate the radio with m_Freq (IDC_FREQ_18_0 corresponds to the ID of the first frequency in the list, 18.0):
void LNPDlg::DoDataExchange(CDataExchange* pDX)<br />
{<br />
<br />
DDX_Radio(pDX, IDC_FREQ_18_0, m_Freq);<br />
}
Then in my constructor, I set m_Freq to whichever value I want chosen at startup, i.e., 0 corresponds to the first entry (18.0), 1 would correspond with the next value, etc.
--
Marcus Kwok
|
|
|
|
|
ricecake wrote:
Then in my constructor, I set m_Freq to whichever value I want chosen at startup, i.e., 0 corresponds to the first entry (18.0), 1 would correspond with the next value, etc.
This assumes that you will always want to access the radio buttons via an "index."
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hi!
how can i load a webpage from some url in to my application using c and sockets.
Thankx
=-=-=-=-=-=-=-=-=-=
Inayat Ali
=-=-=-=-=-=-=-=-=-=
|
|
|
|
|
normally u should use CInternetSession.
if socket, does the server side send the page and allow u connect to the socket pipe?
includeh10
|
|
|
|
|
|
Hello to everybody,
I have added wit the wizard 2 methods for my ActiveX :
PutNumber (ULONG uNumber)
PutData (BYTE* pData )
I compile the application and I run the ActiveX to test it with the Container of Visual Studio. I have set two stop points in both methods. When I invoke the first method, it works well. It goes inside the function but when I try the second one it doesn't work...I think it is a problem that pData is a pointer cause I have created several methods to test it and it doesn't work only when I use a pointer.
Please Help
Thanks
Javi
|
|
|
|
|
Check out the data type converion ur using, coz u might be passing some other datatype n while using pointers always chekout type conversion.
|
|
|
|
|
hi
i wrote a function which conjnects me to an online mysql database from my app. when i use the function from a win32 console application, all is well. when i port the same function to my mfc application, it gives all sorts of linker errors saying that there's a conflict between libc.lib and mysql++.lib. putting libc.lib or libcmt.dll in the ignore library list from the settings does not help.
anybody have any idea ? you guys ever used mysql++ from an mfc application ? if yes please give me the project settings and a few snippets ....
thanks in advance.
kane
"Some guys hack just to get themselves a girlfriend.What a pathetic reason huh ?"
www.coderkane.com
|
|
|
|
|
Did you compile MySQL++ yourself, or download a precompiled version? If you compiled the latest version yourself, and you used the provided .vcproj, it should have built with the Multithreaded DLL version of the C run-time.
The default configuration for a Win32 Console Application is to use the single-threaded static library CRT. The default for an MFC application is to use the multithreaded DLL. You can't mix-and-match within an application - if you're going to use the MFC DLL you must use the CRT DLL.
The home page[^] suggests that before version 1.7.16, the single-threaded static CRT was used.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Thanks for the help Mike!
i downloaded my mysql++ from this website only, i downloaded the precompiled "ancient" version because i have visual studio 6 with service pack 6. my mysql++ version is 1.7.1 the page says that newer versions won't build with vc++6..what do u suggest i should do ? Can i compile the lib with borland c++ and use it in my vc++ projects ? or is it absolutely necessary for me to upgrade..?
kane
"Some guys hack just to get themselves a girlfriend.What a pathetic reason huh ?"
www.coderkane.com
|
|
|
|
|
I use pipes with CreateProcess(), but my code works well on win98 and doesn't work on XP.
only special code for XP in my app looks like:
=========================
void*psd=0;
LPSECURITY_ATTRIBUTES psa=0;
DWORD bNT=(GetVersion()<0x80000000)?1 ;
if(bNT)
{
psd=::GlobalAlloc(GPTR,SECURITY_DESCRIPTOR_MIN_LENGTH);
::InitializeSecurityDescriptor(psd,SECURITY_DESCRIPTOR_REVISION);
::SetSecurityDescriptorDacl(psd,-1,0,0);
psa=(LPSECURITY_ATTRIBUTES)::GlobalAlloc(GPTR,sizeof(SECURITY_ATTRIBUTES));
psa->nLength=sizeof(SECURITY_ATTRIBUTES);
psa->lpSecurityDescriptor=psd;
psa->bInheritHandle=1;
}
const BOOL bOK=CreateProcess(0,pszCmdLine,psa,0,1,0,0,0,&si,&pi);
//======================================
do i need more special code for XP?
thx
includeh10
|
|
|
|
|
includeh10 wrote:
doesn't work on XP.
Define "doesn't work." Are you getting a compiler/linker error, a runtime error, a fired assertion, or a thrown exception?
includeh10 wrote:
void*psd=0;
Shouldn't this be:
PSECURITY_DESCRIPTOR psd = 0; includeh10 wrote:
::SetSecurityDescriptorDacl(psd,-1,0,0);
I'm not sure of the behavior of this function when bDaclPresent is neither 0 nor 1.
includeh10 wrote:
const BOOL bOK=CreateProcess(0,pszCmdLine,psa,0,1,0,0,0,&si,&pi);
What happens if you call this function with lpProcessAttributes set to NULL ?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
"doesn't work" means that messages do not exchange between pipes at all, the dos app respones for command in CreateProcess(), after that, communication stops.
i will test ur suggestion.
includeh10
|
|
|
|
|
DavidCrow wrote:
What happens if you call this function with lpProcessAttributes set to NULL?
lpProcessAttributes!=0 is commented by docs, which say it is special for NT.
if lpProcessAttributes=NULL, it is the same (works on Win98 but not on XP).
I had many apps which use code above and work well on all platform - but they are Windows apps, not DOS one.
i can not find reason why the code has trouble on DOS app.
by the way, PSECURITY_DESCRIPTOR is just void*, some people define many sick definitions.
thx
includeh10
|
|
|
|
|
includeh10 wrote:
lpProcessAttributes!=0 is commented by docs, which say it is special for NT.
I see it saying that the handle cannot be inherited and the process gets a default security descriptor. In any case, ...
includeh10 wrote:
if lpProcessAttributes=NULL, it is the same (works on Win98 but not on XP).
Which should indicate to you that the following code has no bearing on the problem:
DWORD bNT=(GetVersion()<0x80000000)?1:0;
if(bNT)
{
psd=::GlobalAlloc(GPTR,SECURITY_DESCRIPTOR_MIN_LENGTH);
::InitializeSecurityDescriptor(psd,SECURITY_DESCRIPTOR_REVISION);
::SetSecurityDescriptorDacl(psd,-1,0,0);
psa=(LPSECURITY_ATTRIBUTES)::GlobalAlloc(GPTR,sizeof(SECURITY_ATTRIBUTES));
psa->nLength=sizeof(SECURITY_ATTRIBUTES);
psa->lpSecurityDescriptor=psd;
psa->bInheritHandle=1;
} Remove this and the problem becomes more refined. By removing unnecessary code, you'll eventually get down to just the few lines that are necessary to demonstrate the problem.
includeh10 wrote:
by the way, PSECURITY_DESCRIPTOR is just void*,
Fair enough, but it would make more sense to others if PSECURITY_DESCRIPTOR were used. There's also the (small) possibility that it may change from void* in the future.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hello!
I need to interface my VC++ application with Outlook Express 6.0.
I'd need:
- access to email messages in Outlook folders,
- eventually, copy email messages in other files (with EML format and other
place);
- make email messages and send them with Outlook Express (Outbok).
I found a very useful sample on codeproject.com (made by Pablo Yabo), about using IStoreFolder and IStoreNamespace to manage Outlook Exp folders.
But ... what about outgoing emails? The sample can just make a "streamed" file, that's not sent by Outlook Express.
Do I need to use IMimeMessage interface?
Is there any sample that show the use of IMimeMessage interface?
Thank you in advance!
Chiara
|
|
|
|
|
|