|
try #pragma comment( linker, "/ENTRY:WinMain" ), but the function mustn have any parameters!!
get the hinstance by GetModuleHandle, and the cmdline by GetCommandLine
Don't try it, just do it!
|
|
|
|
|
RegSetValueEx(SubKey3,"ValueName",0,REG_DWORD,?,?);
I know it's supposed to look kinda like this, but I can't figure out how to properly set those last two variables. I don't have any trouble with String values, but for some reason, I just can't seem to make DWORDs work for me.
halblonious
|
|
|
|
|
Straight from MSDN:
HKEY hk;
DWORD dwData = EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE | EVENTLOG_INFORMATION_TYPE;
RegSetValueEx(hk,
"TypesSupported",
0,
REG_DWORD,
(LPBYTE) &dwData,
sizeof(DWORD));
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Sweet! It works! It seems so simple now that you've told me. Hehe...I'm a dummy. Thanks a ton!
halblonious
|
|
|
|
|
When I start the VS.Net 2003, it shows the projects name and the
last modified date. However, the last modified date would not update
as I modified it. For example, I opened a project called "BlackJack"
on 10/1/03, and I have been working on it ever since. However, the
modified date still shows 10/1/03.
This problem only occurs in VS.Net version 2003. When I was using
VS.Net 2002, it was okay, and no this problem.
Anyony knows how to fix that?
|
|
|
|
|
Why wouldn'y anyone just answer me? I just want to know if that happened
to you too.
Thanks.
|
|
|
|
|
Hi,
I have 4 toolbars on top of my application and if I right-click on the menu
, i can enable/disable the toolbar. The thing is I have done for 3 of 4 toolbars in my application, but not the last one.
MainFrm.cpp messagemap
ON_COMMAND_EX(IDR_MYTOOLBAR, OnToggleBar)
ON_UPDATE_COMMAND_UI(IDR_MYTOOLBAR, OnUpdateBarMenu)
two function for this particular toolbar
in side of OnToggleBar my code is like this.
CControlBar * pToolBars = GetControlBar( nID );
if ( pToolBars != NULL )
{
ShowControlBar( pToolBars ,!IsBarVisible( pToolBars ), FALSE );
return TRUE;
}
the problem is GetControlBar returns ??? for IDR_MYTOOLBAR at the invocation.
I have checked with the resource ID conflict with others. no problem.
What could be the reason ? Anyone can help me?
Thanks in advanced.
Shin
|
|
|
|
|
i have a bitmap image loaded into an HBITMAP
i need to copy a part of it to a new HBITMAP
or crop the current HBITMAP...
how do i setup the DC's and bitblt it to the new HBITMAP
i'm not drawing anything on screen this is done on a button click....
thanks,
-Slim
|
|
|
|
|
Create a pair of temporary DCs ( CreateCompatibleDC (NULL) ).
Create your destination bitmap. ( CreateCompatibleBitmap / CreateBitmap ).
Select the two bitmaps into the two DC (remembering to keep the HBITMAPS returned from SelectObject).
BitBlt from A->B. Or StretchBlt.
Select the "old" bitmaps back into the temporary DCs.
Destroy the DCs.
Enjoy your new cropped bitmap.
Iain.
|
|
|
|
|
Hi have a quick question(hopefully).
I've got a multithreaded ATL component for dealing with RAS.
I've been told I should put CriticalSections around certain areas of the system.
My container application creates 8 instances of the Component and each instance creates 2 child threads.
Do I need some form of parent Container to put in a CriticalSection, or do I put the criticalsection in each instances constructor/destructor.
|
|
|
|
|
It is less simple than that. You need to put Enter/LeaveCritSect's around access to shared resources.
If each of your instances are independent, then you don't need any critical sections. You may need
CritSects in the sub-threads if they can collide when accesses common resources.
So the general answer is "it depends".
The fewer CriticalSections you have the better as it means your components will run that little bit
more smoothly, especially on multi-threaded systems. But it is more important to be safe.
I hope this sort-of-helps.
Iain.
|
|
|
|
|
Hello all,
I created a Month calendar control into my form, and I want to use it as a date picker, so when the user selects a date, I will fill other CEdit controls with the date selected.
But I realize that within MCN_SELECT, the value associated with my Calendar Control, gets the wrong date.
void CPlanmView::OnSelectMonthcalendar1(NMHDR* pNMHDR, LRESULT* pResult)
{
// Users Selects a Date, so MCN_SELECT triggers this.
// User selected October 31, 2003 but returns
// Feb,10,2004
*pResult = 0;
UpdateData();
m_DiaPlm.Format("%d",m_CalendarVal.GetDay());
m_MesPlm.Format("%d",m_CalendarVal.GetMonth());
m_AnoPlm.Format("%d",m_CalendarVal.GetYear());
UpdateData(FALSE);
}
I have also seen the sample provided in the msdn, and it has the same problem, for this control.
Any Ideas on how to workaround this issue.
Best,
-Alfredo
|
|
|
|
|
Alfredo,
I use that control and never had that problem...
How you are initialing it. please put some of code
best regards
Carlos Antollini.
Pi Five[^]Creator
|
|
|
|
|
Carlos,
Thanks for your reply, well I just created it with no code. I mean I put it on my form dragging the control.
But I just saw that msdn sample and here is the code, still doesn't work in that way.
BOOL CMonthCalPage::OnInitDialog()
{
CPropertyPage::OnInitDialog();
CWnd *pFrame = GetDlgItem(IDC_MCFRAME);
CRect rcWnd;
pFrame->GetClientRect(rcWnd);
pFrame->DestroyWindow(); //pFrame was just a placeholder anyway.
m_MonthCal.Create(WS_CHILD|WS_VISIBLE,CPoint(rcWnd.left,rcWnd.top),this,IDC_MONTHCAL);
UpdateData(FALSE);
return TRUE;
}
Thanks for helping
Alfredo
Best,
Alfredo
|
|
|
|
|
I've got an SSL app (SSL=Yes,HTTPS=No), it communicates to the internet on port 443.
Some customers require all traffic on 80/443 to be routed into a proxy (HTTP/HTTPS).
Does anyone have any information on how to communicate with a (https) proxy server, on the SSL channel (port 443)?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.santacruznetworks.com">Santa Cruz Networks</A>
|
|
|
|
|
Hi ALL,
I have overriden the OnSetFocus() for CComboBoxEx control by trapping the WM_SETFOCUS event. This event gets fired only when i tab to that control from another control. This function does not get invoked when i click on the ComboBoxEx control using the mouse. I have some edit controls also on the same dialog and the setfocus event gets fired when i click those controls.
Any ideas why the CComboBox is not working?
thanks,
Suresh
|
|
|
|
|
It works for me,
In your combo properties, what type you have specified.
DropDown, Simple, DropList.
Have you tried that?
Best,
-Alfredo
|
|
|
|
|
Alfredo,
Thanks a bunch for your response. I have already tried all the three properties, but unfortunately it does not work. Are you using CComboBox or CComboBoxEx?. I tried using CComboBox instead of CComboBox and it does work. Please let me know your comments and thanks again for your help.
Suresh
|
|
|
|
|
You're right I was using CComboBox not CComboBoxEx.
But I am trying to look for another application using CComboBoxEx, let me do some tests and I'll get back to you.
Best,
Alfredo
|
|
|
|
|
Suresh,
I just created a CComboBoxEx into my project (Dragging the ctrl into my form), went to class wizard and added the function for the SETFOCUS handle event, placed a MessageBox("Got the Focus", NULL, MB_OK) and it worked as expected.
How are you creating your control? Have you tried doing exactly the same thing I just did? Visual C++ 6.0 right?
Are you creating a class for you control?
I suggest you to try to do the same thing I did in another project to see if it works.
Good Luck
Best,
Alfredo
|
|
|
|
|
Alfredo,
Thanks a lot for your help on this regard. I got it working by trapping the CBN_SETFOCUS event. Thanks again for your help.
LRESULT CConfigCmbFieldWnd::WindowProc( UINT message, WPARAM wParam, LPARAM lParam )
{
// Trap the
if ( CBN_SETFOCUS == HIWORD( wParam ) )
{
CTraceConfigPage* pTraceConfigPage = DYNAMIC_DOWNCAST(CTraceConfigPage, GetParent());
ASSERT( NULL != pTraceConfigPage );
// assign the current control ID
pTraceConfigPage->SetFieldCtrlID(m_iFieldCtrlID);
}
return CComboBoxEx::WindowProc( message, wParam, lParam) ;
}
|
|
|
|
|
Hi! I need to create a program on keyboard hook on C++. The problem is that I'm confuse on how to use the SetWindowsHookEx() especially on the first parameter idHook. Can anyone give me advice on this matter?
Thank you in advance.
|
|
|
|
|
Will71 wrote:
The problem is that I'm confuse on how to use the SetWindowsHookEx() especially on the first parameter idHook.
It's the type of hook that you are interested in installing. The documentation sums it up real well. In your case, it sounds like you want a WH_KEYBOARD or WH_KEYBOARD_LL hook.
Will71 wrote:
Can anyone give me advice on this matter?
Aside from Googling, you can also search the CP articles for SetWindowsHookEx() .
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
DavidCrow wrote:
WH_KEYBOARD or WH_KEYBOARD_LL hook
Thank you for your quick response.
Let me rephrase my question. I tried using WH_KEYBOARD or WH_KEYBOARD_LL on the parameters before, but it always give me unknown identifier when I compile. I also tried "complete word" but it never shows these two hooks.
Thank you again.
|
|
|
|
|
Will71 wrote:
...but it always give me unknown identifier when I compile.
It sounds as though you failed to include a header file. Perhaps you could provide a code snippet and the compiler message.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|