|
Does this article[^] help?
Regards,
Sandip.
|
|
|
|
|
Why not just create them at design time, and then enable/disable them accordingly? It's much easier that way.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hello,
i use a function MultiByteToWideChar() to show Unicode letters, Arabic and Cyrillic letters are showed properly,
but not the Chinese or Korean or Japanese letters!
I try to show text from Internet in my list control, but they are only a funny square showed instead of letters ,
does any one have suggestion how to start to solve my issue?
Thanks for any help
termal
|
|
|
|
|
Are you sure the font in the edit control has these characters? You can use the charmap utility to check.
Also guessing, did you create the control using CreateWindowW? Maybe the control is being all ASCII-y ?
Try making your project UNICODE (which you should anyway) and see if the problem goes away?
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
Hi,
first thanks for answer!
I create a dialog with the designer of VS and the CListCtrl i added from a toolbox!
And project is in unicode, other languages are showed normal!
"Are you sure the font in the edit control has these characters? You can use the charmap utility to check"
This can be a reason tor my problem, i use Tahoma as font for all my dialogs and i can't find any chinese character in charmap utility!!
regards
termal
|
|
|
|
|
You may need to install the language pack for Asian languages.
«_Superman_»
|
|
|
|
|
Hi,
yes i found that they are not installed by default!
regards
termal
|
|
|
|
|
Hi,
i found my font it's Arial Unicode MS
bye
termal
|
|
|
|
|
I want to change the image of the toolbar button, that is, When I cilcked one tool bar button then I want to change the image of the button. So I have used the following code, but it saying some runtime error.
CToolBarCtrl &ctrl = m_wndToolBar.GetToolBarCtrl();
ctrl.AddBitmap(3,IDB_BITMAP3);
Pls provide me some solution,
|
|
|
|
|
try using LoadImages(). and what is this AddBitmap?
|
|
|
|
|
gopalraja wrote: ctrl.AddBitmap(3,IDB_BITMAP3);
This function is used to add bitmap to imagelist associated with toolbar control.
Look at function SetImageList, and use it according to your need.
Images on toolbar shown according to imagelist associated with that toolbar control.
|
|
|
|
|
Hi,
You can set cold and hot images for the toolbar.
This is the sample code.
CImageList img;
img.Create(IDB_HOTTOOLBARS, 22, 0, RGB(128, 128, 128));
m_wndToolBars.GetToolBarCtrl().SetHotImageList(&img);
img.Detach();
img.Create(IDB_COLDTOOLBAR, 22, 0, RGB(255, 255, 255));
m_wndToolBars.GetToolBarCtrl().SetImageList(&img);
img.Detach();
Here m_wndToolBars is the CToolBar object.And IDB_HOTTOOLBARS and IDB_COLDTOOLBAR are the Bitmap imges in the resourse editor.
Regards
Arun
|
|
|
|
|
I want the source code for getting list of software installed in a system.
|
|
|
|
|
You had posted same question previously for which you got answers.. What is problem with those answers
Why reposting again?
Regards,
Sandip.
|
|
|
|
|
|
I am working on a 64 bit system (windows XP).I have a problem in launching an MFC dialog, that contains an active-x control (MSFlex Grid control).My project builds successfully without any errors.But when i try to launch this dialog, i get an error "Debug Assertion Failed".My Msflxgrd.ocx file is registered successfully.I don't understand where the problem is.Do let me know where the problem is.Please help me out ......
Thnx in advance.
|
|
|
|
|
This problem can arise if the dialog application is build for x64 and the flex grid is a 32 bit activeX.
«_Superman_»
|
|
|
|
|
Firstly, thnx for the reply.
I have a question, though...if i am working on a 64bit machine, then the active x control (Msflxgrd.ocx) will be for 64bit right?How is it possible that i can built a dialog for 64bit with 32 bit active x control?Is there anything else that is required to be done on my project settings or any other file that i am suppose to use or download.Please do lemme know. Thnk You.
|
|
|
|
|
It is not necessary that the flex grid is also 64 bit.
Even though the OS is 64 bit, you can create 32 bit binaries.
Basically a 64 bit binary cannot load any 32 bit modules (.dll, .ocx etc.)
Similarily 32 bit binaries cannot load 64 bit modules.
So make sure the dialog app and flexgrid have the same bitness.
«_Superman_»
|
|
|
|
|
I have checked my dialog app and flexgrid.Both are 64bit.
I don't just understand what the problem is.Please do let me know.
|
|
|
|
|
If you can give me the stack trace and the code in you InitDialog function I could try and find out.
«_Superman_»
|
|
|
|
|
Hi....
My code is pasted here below.I developed this in VS 2005, type of project: MFC Application(.exe)
When i debug the code, it fails in function CreateDlgIndirect (in dlgcore.cpp which is system file)
Please do have a look.Thnx again.
BOOL CMFCExecutableApp::InitInstance()
{
// InitCommonControlsEx() is required on Windows XP if an application
// manifest specifies use of ComCtl32.dll version 6 or later to enable
// visual styles. Otherwise, any window creation will fail.
INITCOMMONCONTROLSEX InitCtrls;
InitCtrls.dwSize = sizeof(InitCtrls);
// Set this to include all the common control classes you want to use
// in your application.
InitCtrls.dwICC = ICC_WIN95_CLASSES;
InitCommonControlsEx(&InitCtrls);
CWinApp::InitInstance();
if (!AfxSocketInit())
{
AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
return FALSE;
}
// Initialize OLE libraries
if (!AfxOleInit())
{
AfxMessageBox(IDP_OLE_INIT_FAILED);
return FALSE;
}
AfxEnableControlContainer();
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need
// Change the registry key under which our settings are stored
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization
SetRegistryKey(_T("Local AppWizard-Generated Applications"));
LoadStdProfileSettings(4); // Load standard INI file options (including MRU)
// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views
CMultiDocTemplate* pDocTemplate;
pDocTemplate = new CMultiDocTemplate(IDR_MFCExecutableTYPE,
RUNTIME_CLASS(CMFCExecutableDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CMFCExecutableView));
if (!pDocTemplate)
return FALSE;
AddDocTemplate(pDocTemplate);
// Connect the COleTemplateServer to the document template
// The COleTemplateServer creates new documents on behalf
// of requesting OLE containers by using information
// specified in the document template
m_server.ConnectTemplate(clsid, pDocTemplate, FALSE);
// Register all OLE server factories as running. This enables the
// OLE libraries to create objects from other applications
COleTemplateServer::RegisterAll();
// Note: MDI applications register all server objects without regard
// to the /Embedding or /Automation on the command line
// create main MDI Frame window
CMainFrame* pMainFrame = new CMainFrame;
if (!pMainFrame || !pMainFrame->LoadFrame(IDR_MAINFRAME))
{
delete pMainFrame;
return FALSE;
}
m_pMainWnd = pMainFrame;
// call DragAcceptFiles only if there's a suffix
// In an MDI app, this should occur immediately after setting m_pMainWnd
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// App was launched with /Embedding or /Automation switch.
// Run app as automation server.
if (cmdInfo.m_bRunEmbedded || cmdInfo.m_bRunAutomated)
{
// Don't show the main window
return TRUE;
}
// App was launched with /Unregserver or /Unregister switch. Unregister
// typelibrary. Other unregistration occurs in ProcessShellCommand().
else if (cmdInfo.m_nShellCommand == CCommandLineInfo::AppUnregister)
{
m_server.UpdateRegistry(OAT_DISPATCH_OBJECT, NULL, NULL, FALSE);
AfxOleUnregisterTypeLib(_tlid, _wVerMajor, _wVerMinor);
}
// App was launched standalone or with other switches (e.g. /Register
// or /Regserver). Update registry entries, including typelibrary.
else
{
m_server.UpdateRegistry(OAT_DISPATCH_OBJECT);
COleObjectFactory::UpdateRegistryAll();
AfxOleRegisterTypeLib(AfxGetInstanceHandle(), _tlid);
}
// Dispatch commands specified on the command line. Will return FALSE if
// app was launched with /RegServer, /Register, /Unregserver or /Unregister.
if (!ProcessShellCommand(cmdInfo))
return FALSE;
// The main window has been initialized, so show and update it
pMainFrame->ShowWindow(m_nCmdShow);
pMainFrame->UpdateWindow();
return TRUE;
}
|
|
|
|
|
I would like to see the code where the actual crash happens.
I'm guessing this is the code where the dialog or form view is being initialized.
«_Superman_»
|
|
|
|
|
Hi.....
Thnx for the reply.I have pasted the code below from dlgcore.cpp.The code fails at function CreateDlgIndirect.Do have a look.
If possible plse create an MFC Application in VS 2005 and insert an active x control (MS FLEX GRD) and execute it.i think you might get the error "Debug Assertion failed", while executing the dialog.to remind, my system is a 64bit system .Thnx once again.Please do let me know if you get to know the problem.
thnx.
INT_PTR CDialog::DoModal()
{
// can be constructed with a resource template or InitModalIndirect
ASSERT(m_lpszTemplateName != NULL || m_hDialogTemplate != NULL ||
m_lpDialogTemplate != NULL);
// load resource as necessary
LPCDLGTEMPLATE lpDialogTemplate = m_lpDialogTemplate;
HGLOBAL hDialogTemplate = m_hDialogTemplate;
HINSTANCE hInst = AfxGetResourceHandle();
if (m_lpszTemplateName != NULL)
{
hInst = AfxFindResourceHandle(m_lpszTemplateName, RT_DIALOG);
HRSRC hResource = ::FindResource(hInst, m_lpszTemplateName, RT_DIALOG);
hDialogTemplate = LoadResource(hInst, hResource);
}
if (hDialogTemplate != NULL)
lpDialogTemplate = (LPCDLGTEMPLATE)LockResource(hDialogTemplate);
// return -1 in case of failure to load the dialog template resource
if (lpDialogTemplate == NULL)
return -1;
// disable parent (before creating dialog)
HWND hWndParent = PreModal();
AfxUnhookWindowCreate();
BOOL bEnableParent = FALSE;
#ifndef _AFX_NO_OLE_SUPPORT
CWnd* pMainWnd = NULL;
BOOL bEnableMainWnd = FALSE;
#endif
if (hWndParent && hWndParent != ::GetDesktopWindow() && ::IsWindowEnabled(hWndParent))
{
::EnableWindow(hWndParent, FALSE);
bEnableParent = TRUE;
#ifndef _AFX_NO_OLE_SUPPORT
pMainWnd = AfxGetMainWnd();
if (pMainWnd && pMainWnd->IsFrameWnd() && pMainWnd->IsWindowEnabled())
{
//
// We are hosted by non-MFC container
//
pMainWnd->EnableWindow(FALSE);
bEnableMainWnd = TRUE;
}
#endif
}
TRY
{
// create modeless dialog
AfxHookWindowCreate(this);
if (CreateDlgIndirect(lpDialogTemplate,
CWnd::FromHandle(hWndParent), hInst))
{
if (m_nFlags & WF_CONTINUEMODAL)
{
// enter modal loop
DWORD dwFlags = MLF_SHOWONIDLE;
if (GetStyle() & DS_NOIDLEMSG)
dwFlags |= MLF_NOIDLEMSG;
VERIFY(RunModalLoop(dwFlags) == m_nModalResult);
}
// hide the window before enabling the parent, etc.
if (m_hWnd != NULL)
SetWindowPos(NULL, 0, 0, 0, 0, SWP_HIDEWINDOW|
SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE|SWP_NOZORDER);
}
}
CATCH_ALL(e)
{
DELETE_EXCEPTION(e);
m_nModalResult = -1;
}
END_CATCH_ALL
#ifndef _AFX_NO_OLE_SUPPORT
if (bEnableMainWnd)
pMainWnd->EnableWindow(TRUE);
#endif
if (bEnableParent)
::EnableWindow(hWndParent, TRUE);
if (hWndParent != NULL && ::GetActiveWindow() == m_hWnd)
::SetActiveWindow(hWndParent);
// destroy modal window
DestroyWindow();
PostModal();
// unlock/free resources as necessary
if (m_lpszTemplateName != NULL || m_hDialogTemplate != NULL)
UnlockResource(hDialogTemplate);
if (m_lpszTemplateName != NULL)
FreeResource(hDialogTemplate);
return m_nModalResult;
}
|
|
|
|
|
Hello,
I have two programs that run well independently. One controls motion, the other is for viewing with a webcam. Each is intended for a human operator.
I have c++ source code for the camera program.
I do not have source code for the motion controller but I do have c++ source code for a dll plugin for the motion controller. The plugin has the necessary functions.
I would like to add a feature to the camera program so that it calls a function in the motion controller plugin and gets the returned value.
How can I define a function in the motion controller plugin so that it is callable from the camera program?
What is this scenario called and what keywords will help me search for information or examples?
Tom Hubin
thubin@earthlink.net
|
|
|
|