|
Correct it very simply.
CoInitialize(NULL);
CComPtr spMLang;
DetectEncodingInfo lpInfo[1000];
INT pnScores;//Incorrect code inmust be specify as size of lpInfo (INT pnScore=1000)
wchar_t * wzContent;
if (SUCCEEDED(hr = spMLang.CoCreateInstance(CLSID_CMultiLanguage)))
{
spMLang->DetectInputCodepage(MLDETECTCP_NONE, 0, szContent, &nlen, lpInfo,
npScore); // app crash here
}
CoUninitialize();
|
|
|
|
|
hello!
I would like to know if the urls entered in the IE can be captured.
I plan to make something like a firewall "check on the urls specified" and if requested for some specific site that is noted in the program,then it requests for an another site.how do i do this? any specific windows apis?
all ideas are welcome!
|
|
|
|
|
I need to make to socket connection to two differnt places with two different remote address and remote port. the question is if I could use the same local port for those connection.
lets say, local port 1250, and remote port 1251 for first connection and and 10000 for the second.
would it work?
Thanks for help.
|
|
|
|
|
I am new to MFC programming. Iam trying to create a dialog box that has to hold data that would run to 3 to 4 pages. I should be able to access all of them by scrolling(horizontal and vertical) the dialog window. I am trying this in a SDI application using VC++ 6.0 Can anyone help / guide me in this regard?
Thanks
|
|
|
|
|
Hi,
I would suggest you to use FormView instead of dialog. you can add controls to the view like a dialog and since its derived from scroll view, scrolling is added by default.
Bye,
Cool Ju
Dream Ur Destiny
|
|
|
|
|
hey there.........thanks for the suggestion.
But as i SAId, i have just started to learn MFC's.
What is Formview? How do I implement this?
Can u help me out?
Thanks.
|
|
|
|
|
Hi,
Check this Form Views[^]
Bye,
Cool Ju
Dream Ur Destiny
|
|
|
|
|
thathvamasi wrote: I am trying this in a SDI application...
Simply derive the view from CFormView . It's one of the last things that AppWizard prompts you with.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
HEY...
thanks for the help.
I tried using CFormView ...
but when I build and run, the main window or the dialog window doesnt show up. I must be missing some line..
i tried debugging but in vain......
any help appreciated.
thanks heaps......
|
|
|
|
|
I want to programatically launch all menus and the submenu items belonging to each menu using their short cut keys only.
e.g in wordpad programatically launch 'File' menu using 'Alt+F' key. once the 'File' menu is up and displayed we have to programatically launch all 'File' submenu items one after the other e.g submenu item 'New' using 'Alt+N' key next launch 'Open' submenu item using ''Alt+O' and so on.
I cld retrieve all short cut keys for menu and submenu items and have logged it into a file.i have extracted the shortcut key from each menu and submenu text using GetMenuString(). I plan to append it to 'Alt' to get 'Alt+F' and so on and use this shorcut key to launch each.pls suggest how do i go ahead from here??
i can take care of closing each window launched by the submenu item but launching menu and submenu items programatically with shortcut keys is posing a problem.
urgent help needed. Pls suggest me a sample code if any.
Thanks in advance.
Sincerely
Giftsana
Singapore
|
|
|
|
|
Hi,
I created a MFC doc/view application.
1. When the main window( the mdi ) is loaded it displays a empty chiled form. I don't want it to display anything.
2.Now I have dialog which i want to dock along the bottom of the parent window when it's displayed.
I am really enw and have done readings and stuff onlien but nothing seem to point in right direction.
Any pointers towards this?
Any help is appreciated
Thanks
|
|
|
|
|
hi ven,
for this approach follow this steps you will get.
1) in OnInitialUpdate(...) of the MDI Form call a
SendMessage(...,Functionname(...))/PostMessage(...,Functionname(...))
in the FunctionName(...) initiate the
Dialog Dlgname d;
d.DoModel(...);
thats it! you will get Cheers and You will get it.
good luck..
uday.
uday kiran
|
|
|
|
|
where is this OnInitialUpdate
sorry am new to MFC.
|
|
|
|
|
I did that man. here is the problem
first if i get rid of the startup child form, the CGUIView OnInitialUpdate does not even get called, so that code do nothing.
Second i have no idea how to use SendMessage
but this is what i did:
void CQCProGUIView::OnInitialUpdate( )
{
LoadLaunchBar( );
}
int CQCProGUIView::LoadLaunchBar( )
{
m_launchbar = new CLaunchBar( );
m_launchbar->DoModal( );
return 0;
}
now this what this does is basically the application runs, but i don't seee anything at all( not even main MDi form ).
if i replace that with:
m_launchbar->ShowWindow( SW_NORMAL);
the following assertion fails:
BOOL CWnd::ShowWindow(int nCmdShow)
{
ASSERT(::IsWindow(m_hWnd) || (m_pCtrlSite != NULL));
if (m_pCtrlSite == NULL)
return ::ShowWindow(m_hWnd, nCmdShow);
else
return m_pCtrlSite->ShowWindow(nCmdShow);
}
|
|
|
|
|
Hi,
Add cmdInfo.m_nShellCommand =CCommandLineInfo::FileNothing;
in Initinstance().
Bye,
Cool Ju
Dream Ur Destiny
|
|
|
|
|
hey thanks cool ju, that FileNothign worked like a charm.
am still trying to show up the dialog thou
|
|
|
|
|
Hi,
Instead of Dialog use a DialogBar which can be docked like a toolbar. Create the dialog bar in MainFrm::OnCreate() function and dock it where ever you want.
Adios,
Cool Ju
Dream Ur Destiny
|
|
|
|
|
how do you dock, actually I am using a dialog bar
I thoguht docking was not possible , so i was doign poisitioning and sizing myself.\
how would you suggest I try docking?
|
|
|
|
|
Hi,
You have to the dock the dialogbar using SetWindowPos() function.
I suggest you to do in MainFrm class not in View class.
Insert a dialog and change the style to child.
Declare a CDialogbar object(eg: m_dlgbar) in MainFrm.h
In MainFrm::OnCreate funtion
m_dlgBar.Create(this, Id of the dialog template,CBRS_LEFT|CBRS_TOOLTIPS|CBRS_FLYBY,id of the dialog template);
m_dlgBar.SetWindowPos(&m_wndStatusBar, x,y,cx,cy,SWP_NOSIZE|SWP_NOMOVE);
Adios,
Cool Ju
Dream Ur Destiny
|
|
|
|
|
A couple fo things:
1. The object was a CDialog so I changed the base class to CDialogBar
2.I used following code
m_launchbar->Create( this,IDD_LAUNCHBAR,CBRS_BOTTOM ,IDD_LAUNCHBAR );
this docs the window fine at the bottom without any setting of position and size using the SetWindowPos.
Now what happens is every button on the dialogbar is disabled and it took away the WinXp kind of look from the buttons too!!!
Any ideas, am reading MSDN too on this.
Thanks for your help , it was awesome
|
|
|
|
|
I have a code base that can produce two separate programs with different functionality. This functionality is controlled via #defines in the main code. I would like to use the same #define to control the program’s icon, and the wording in a few menus. I found that the following code will allow me to control the icon:
<br />
#if defined(APSTUDIO_INVOKED)<br />
IDR_MAINFRAME ICON "..\\res\\MAIN.ico"<br />
#else<br />
#if defined(MAIN_PROG)<br />
IDR_MAINFRAME ICON "..\\res\\MAIN.ico"<br />
#else<br />
IDR_MAINFRAME ICON "..\\res\\SECONDARY.ico"<br />
#endif<br />
#endif<br />
The problem is that as soon as someone actually edits a file with the resource editor, all of the conditional code is removed.
Is it actually possible to conditionally change the icon of a program, and if so what is the recommended method. I’m trying to avoid going to multiple rc files, since we will have to keep them in sync from this point on.
|
|
|
|
|
Yeah, I've noticed that in MSVC6. Bloody annoying and bloody stupid of Microsoft.
Steve
|
|
|
|
|
An RC File is Automatically maintained by the MFC Editor. That's the whole Idea behind IDE, and ofcourse it will wipe it.This is an MFC Feature since the days of Windows 3.1, and NOT a feature of MFC 6.0(or earlier or later) If you want resource code, not edited by the IDE, handwrite it in the .RES File (which is a Text File Similar to the RC File) found in your resource directory(underneath Debug and Release)
Tip, If you do not know the Syntax, create it first in the Resource Editor, then copy the entire text to the .Res File, and then delete the item from your resource editor window. It will still be in the res File, The Resource Editor does no know about that File and will leave it alone)
regards
LateNightsInNewry
|
|
|
|
|
The whole idea of the IDE is not to destroy information but to make it easier to author/modify it. And it has nothing to do with MFC; it's the resource editor where the fault lies and it manifests itself whether MFC is used or not. I used the word "fault" intentionally because it is a fault: There is nothing to stop the resource editor getting the current defines from the project settings for the currently selected configuration and only editing the relevant subset.
Steve
|
|
|
|
|
LateNightsInNewry wrote: ...the .RES File (which is a Text File Similar to the RC File)...
No it's not. It's a temporary binary file that the resource compiler creates.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|