|
|
i need to update one child dialog from other for that i did the following things
when i click on the list view item.
LRESULT CALLBACK GlobaListProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_NOTIFY:
if(((LPNMHDR)lParam)->code == NM_CLICK)
{
iSelect=SendMessage(hList,LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
if(iSelect==-1)
{
break;
}
index=iSelect;
ShowWindow(hWndinoutfiledir,SW_HIDE);
ShowWindow(hwndEncrypt,SW_HIDE);
ShowWindow(hwndSplit,SW_HIDE);
ShowWindow(hwndUpload,SW_HIDE);
<code>ShowWindow(hwndTagEditorDlg ,SW_SHOW);</code>
UpdateWindow(hwndTagEditorDlg);
}
break;
}
}
now i need effect of that click event on the following call back function <code>ShowWindow(hwndTagEditorDlg ,SW_SHOW) </code> its call but its not updated the window with
empty edittext control what should i do?
addtional i want to pass the iSelect value also for the further processing of my global array of object _ProtectSet[index] for dispaly the old values which is stored in objetc.
LRESULT CALLBACK TagEditorProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
Utility util;
switch(message)
{
case WM_INITDIALOG:
if(_ProtectSet[index].listviewIndex==index)
{
SetDlgItemText(hDlg,IDC_EDIT_ARTIST,util.ConvertStringToWCHAR(_ProtectSet[index].artist));
SetDlgItemText(hDlg,IDC_EDIT_ALBUM,util.ConvertStringToWCHAR(_ProtectSet[index].album));
SetDlgItemText(hDlg,IDC_EDIT_YEAR,util.ConvertStringToWCHAR(_ProtectSet[index].year));
SetDlgItemText(hDlg,IDC_EDIT_COPYRIGHT,util.ConvertStringToWCHAR(_ProtectSet[index].copyright));
SetDlgItemText(hDlg,IDC_EDIT_AUTHOR,util.ConvertStringToWCHAR(_ProtectSet[index].author));
SetDlgItemText(hDlg,IDC_EDIT_GENRE,util.ConvertStringToWCHAR(_ProtectSet[index].genre));
SetDlgItemText(hDlg,IDC_EDIT_DESCRIPTION,util.ConvertStringToWCHAR(_ProtectSet[index].desc));
}
break;
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDC_SAVE_TAG:
_ResideId3TagForSelectedFile(hDlg);
MessageBox(hDlg,_T("Your file has been saved"),_T("encoder"),0);
break;
case IDC_HIDDEN_BTN:
MessageBox(0,_T("HAY"),_T("HI"), 0);
::PostMessage(hDlg,WM_INITDIALOG,0,0);
break;
}
break;
}
return FALSE;
}
what should I do ?
Amit
|
|
|
|
|
amitmistry_petlad wrote: i need to update one child dialog from other
Do these have a common parent (e.g. the CDocument)?
If yes, Dlg1 could manipulate the common parent, and the Parent in turn manipulates Dlg2.
This is a much clearer architecture, where only the Patent-class needs to be adapted to changing needs.
Failure is not an option - it's built right in.
|
|
|
|
|
its WIN32 API,
and the parent is common. I didn't get you please briefly introduce me.
so i can understand.
Amit
|
|
|
|
|
Your Dialog knows its Parent.
So you can either send it a user defined message with your iSelect as a parameter, or call a function in your Parent which takes iSelect as a parameter.
Either way, the handler in your parent would then manipulate the second dialog, e.g. by sending it a WM_CLick of WM_SHOW you "made up" or by calling function of this dialog.
So no dialog needs to "know" the other one. Both only know their parent - which they do anyway.
Failure is not an option - it's built right in.
|
|
|
|
|
how can i send it ? could you please provide me piece of code ?
|
|
|
|
|
amitmistry_petlad wrote: could you please provide me piece of code ?
Difficult. I am not using Win32 for a reason: I dont know it.
To send a message, you use SendMessage waits for the message to return or PostMessage , which does not wait.
(Daniel Koptchinski mad a four-part series about message handling: The first entries here[^]
As a message, you can either send a message the target class knows (like WM_SIZE ), or you define a new one (as WM_APP + YourConstant)
Failure is not an option - it's built right in.
|
|
|
|
|
Hello,
I know that microsoft introduced a new concept for deploying application in Visual studio 2005. It requires you to distribute vcredist_x86.exe with your application and launch it on the target machine (this will install all common dll's, like the C runtime, ATL, MFC, ...).
The problem is that it requires to have Administrator rights.
I would like to distribute my app like in the good old days . Simply copy the executable and the required dll's.
Why ? Because we are developping a framework in Java for embedded devices. With this framework, we will be able to install new services dynamically on a machine (in the real sense). Some services are in native and are managed by a Java counterpart. If we want to install our application dynamically, that would mean that the Java framework has to be started with administrator rights, only for this purpose...
Thanks for any help.
|
|
|
|
|
Hi Cédric,
what you are looking for is known as 'Private Assemblies'. The VS2005 DLLs (CRT, ATL, MFC) can be installed as shared assemblies in the WinSxS folder so every application can use them or they can be locally installed as private assemblies. In the latter case only your application will be able to use them.
You'll likely get all necessary information here:
Assembly Searching Sequence[^]
Short summary: If the redistributable package (vcredist_x86.exe) isn't installed on the target machine then your local app folder is checked for the DLLs. I propose to test it well, e.g. Windows 2000 and XP don't behave in the same way.
But the fun really starts if you have an application that has references to VS2005 RTM and SP1 DLLs. So... welcome to Manifest Hell!
cheers,
mykel
OMM: "Let us be thankful we have commerce. Buy more. Buy more now. Buy. And be happy."
|
|
|
|
|
You can still use the static-LIB versions of MFC and the CRT, do that and you won't need to run the redist installer. If you really have to use the DLL versions, you can still do so w/o running the installer, however it involves messing with manifests which I've never taken the time to funny grok, since I always use the static LIB versions.
|
|
|
|
|
|
in older program, I used resource dll to load resource French. but now, I don't
want to use dll. I want to use string table to support multilingual.
use "String Tables" instead of creating a new set of Dialogs for each supported
language. String Tables are to support multiple languages.
Ex:
I have created 2 stringtables (French and English):
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
// String Table
//
STRINGTABLE DISCARDABLE
BEGIN
IDS_CREATE "Create"
END
#endif // English (U.S.) resources
// French (France) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
#ifdef _WIN32
LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
#pragma code_page(1252)
#endif //_WIN32
// String Table
//
STRINGTABLE DISCARDABLE
BEGIN
IDS_CREATE "Crée"
END
#endif // French (France) resources
InitDialog function:
CButton *pButtonName = (CButton *)GetDlgItem(IDC_CREATE); //create a button with ID: IDC_CREATE
m_LoadString.LoadString(IDS_STRING104); //Load stringtable
pButtonName->SetWindowText(m_LoadString); // Set button text
When I compile, button name is Create (Load English Stringtable)
Could you tell me how do I load button name is Crée (Load French Stringtable)
Please show me a solution to solve it.
Thanks a lot
Papais
|
|
|
|
|
1. Please post code only when required.
2. Please use the <pre> </pre> tags to post code.
3. As a specific question.
4. Do not cross post.
Use the ID of your French string with m_LoadString.LoadString instead of IDS_STRING104 to load the French string.
Let us not listen to those who think we ought to be angry with our enemies, and who believe this to be great and manly. Nothing is so praiseworthy, nothing so clearly shows a great and noble soul, as clemency and readiness to forgive.
- Marcus Tullius Cicero
|
|
|
|
|
Did you define AFX_TARG_FRA in your project settings?
Society is composed of two great classes, those that have more dinners than appetite, and those who have more appetite than dinners
Fold with us! ¤ flickr
|
|
|
|
|
Hello,
Is the assignment operator that is = available for CDBVariant class.
If I have
CDBVariant v,m;
v=m;
Should the above assignment give error.
Prithaa
|
|
|
|
|
|
prithaa wrote: Is the assignment operator that is = available for CDBVariant class
No.
prithaa wrote: CDBVariant v,m;
v=m;
Should the above assignment give error.
Yes.
|
|
|
|
|
Hello,
There are 2 answers which I have received and they are contradictory.
so what is it that I should do.
I am getting error if I use the assignment operator.And the error appears when the destructor of CDBVariant is called.It seems that the destructor is not able to delete the CString pointer.
Prithaa
Thanks for the answers
|
|
|
|
|
prithaa wrote: so what is it that I should do.
There is no assignment operator present for this class. You will not get error though, as compiler provides its own version here,which does shallow copy.
prithaa wrote: am getting error if I use the assignment operator.And the error appears when the destructor of CDBVariant is called.
Without relevent code snippet, nobody could satisfy your query.
prithaa wrote: It seems that the destructor is not able to delete the CString pointer.
You are corrupting memory for sure some where in your code.
|
|
|
|
|
prithaa wrote: I am getting error if I use the assignment operator.
This is very confusing. What kind of error ? A compilation error ? If yes, post the appropriate error message.
If it is a run-time error, then you should use your debugger to locate the problem.
|
|
|
|
|
My program is recording plain AVI file and i am looking for way to compress it.
(i don't need realtime processing) just to have opportunity to make file smaller from my program,
so far I produce gigabytes
Is there any free command line coder? (something like LAME or OGGENC for audio)
Or any C++ library for simple codec usage?
Thank you
viliam
|
|
|
|
|
look here
http://www.codeproject.com/audio/avitowmv.asp
Cheers,
Russell
|
|
|
|
|
You could have a look to VirtualDub sources[^]. And if it solves your problem, an article on how you did it would be welcome!
Society is composed of two great classes, those that have more dinners than appetite, and those who have more appetite than dinners
Fold with us! ¤ flickr
|
|
|
|
|
Hi all.
I want to make "BOLD"; the text from a static control.
How I can do this?
Thanks
Sameer Thakur
|
|
|
|
|
Have a look at LOGFONT-->lfWeight .
Set its value to FW_BOLD .
And use this font for static text.
|
|
|
|
|