|
Thanks for your reply.
I was able to solve my problem.
I was calling
SendMessage(WM_NOTIFY, NM_CLICK, (LPARAM)&NMListView);
instead of
<br />
CAddressPage* pAddressPage = (CAddressPage*) this->GetParent();<br />
pAddressPage->SendMessage(WM_NOTIFY, NM_CLICK, (LPARAM)&NMListView);
The Heinikin Uncertainty Principle: You can never be sure how many beers you had last night
|
|
|
|
|
Hi,
I'm using MFC. I've have a handler for NM_CLICK for a listctrl, OnClickList() as shown below
ON_NOTIFY(NM_CLICK, IDC_ADDRESS_LIST, OnClickList)
OnClickList(NMHDR* pNMHDR, LRESULT* pResult)
The OnClickList() contains code which executes when user clicks on a row in the listcontrol. The problem is that, I want execute the same function OnClickList() on some other event as well.
I have the item and subitem index of the listctrl, where I want to simulate click. I tried
::SendMessage api with WM_NOTIFY and NM_CLICK. But I'm not able send the click notification to the list ctrl.
Can somebody illustrate with some sample code on how to do this.
Thanks a lot
|
|
|
|
|
Hello,
does anyone know some easy way (some library or function)
how to retrieve audio file information.
For example length (enough).
something like:
DWORD GetWaveLength(LPCTSTR lpszFile)
something to read this information from header.
It seems to be easy from file header,
but there is many kinds .. - not just PCM Wave format.
(extra header information - not only canonical format)
Does anyone know some library?
Thank you
viliam
|
|
|
|
|
Use AVIFileOpen to get informations about AVI and WAV formats .
For MP3 i thinkl theer is no particular library from mICROSOFT ..
for wma files use windows media format SDK ..
As an example ..
for AVI files ,
PAVIFILE pFile;
PAVIFILE* ppFile=&pFile;
long bResult;
AVIFILEINFO pFileInfo;
int height, width;
AVIFileInit();
str.Replace('\\','/');
//Opening the file
bResult=AVIFileOpen(ppFile,str,OF_READ ,NULL);
//read the strcuture
if (bResult==0)
{
AVIFileInfo(*ppFile,&pFileInfo,sizeof(pFileInfo));
}
AVIFileRelease(*ppFile);
the strcuture AVIFILEINFO will have the required details .The same code applies for WAV files also .....
Problem is external ,the soultion is internal for successs...the reverse is for failure
|
|
|
|
|
Iam doing a project in MFC using ODBC classes ..
1.I created a ODBC DSN for a access database mdb .WHile creating the DSN i did not specify any SYSTEM DATABASE .
2.When i executed the program ,it gave me an error "could not find "c:\cb\debug\dbo.db" .FIrst of all the access database i have given in DSN creation is different from that pointed out in the error message . Secondly the path shown in the ERROR message is the path of the executable .
How do i solve the problem .....
Every LIFE is unique and so there is no use in comparing ....
|
|
|
|
|
Hello, I've installed the msm files that allow me to use chinese and the international phoneme set...
I have done a little application that emulates the one that Microsoft gives as a sample, and the computer reads everything fine, but the problem is that I don't know how to make it read in any other language than english...
does anybody knows how to do it?
PS:
I'd like to read the international phonemes also, but I don't know how to do it... I read phonemes by adding <pron sym=" list_of_phonemes_separated_by_spaces"/>
as always thank you in advance...
|
|
|
|
|
Hy,
I am not familiar with different Windows technologies like MFC, COM, ATL...
I find a sample code with COM-s.
When I want to use MFC stuffs, like CStringArray, or dialogs, I have to
include some headers...
#include <afxcoll.h>
#include <afxwin.h>
After it the compiling working fine, but the linker has some errors, for
example:
Linking...
nafxcw.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in
SimpleDynProps.obj
nafxcw.lib(dllmodul.obj) : warning LNK4006: _DllMain@12 already defined in
SimpleDynProps.obj; second definition ignored
Creating library Debug/ARXS_LX_OPM.lib and object Debug/ARXS_LX_OPM.exp
nafxcw.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argv
nafxcw.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argc
nafxcw.lib(filelist.obj) : error LNK2001: unresolved external symbol
__mbctype
nafxcw.lib(timecore.obj) : error LNK2001: unresolved external symbol
__mbctype
nafxcw.lib(apphelp.obj) : error LNK2001: unresolved external symbol
__mbctype
What is the problem?
Can I use this technologies mixed?
Cheers,
Zoltan
|
|
|
|
|
Check that Project Settings|C/C++|Code Generation|Use Run Time Library matches the settings for the DLL's you are using.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
please help me how can i do !
first i create my new desktop, then open the window station with the name "winsta0", the next step SetProcessWindowStation and SetThreadDesktop are called, but when i call SetThreadDesktop an error occurs, the error number is 170 .
following is the function code(i call this function before showing the main window):
void CEnumDesktopApp::SetMyDesktop(void)
{
hDesktopCurrent = NULL;
hDesktopCurrent = GetThreadDesktop(GetCurrentThreadId());
hDeskDefault = NULL;
hDeskDefault = OpenDesktop("default", 0, FALSE,
DESKTOP_CREATEMENU |
DESKTOP_CREATEWINDOW |
DESKTOP_ENUMERATE |
DESKTOP_HOOKCONTROL |
DESKTOP_JOURNALPLAYBACK |
DESKTOP_JOURNALRECORD |
DESKTOP_READOBJECTS |
DESKTOP_SWITCHDESKTOP |
DESKTOP_WRITEOBJECTS);
if (hDeskDefault == NULL)
{
return ;
}
hDesktopLlx = NULL;
hDesktopLlx = OpenDesktop("llx", 0, FALSE,
DESKTOP_CREATEMENU |
DESKTOP_CREATEWINDOW |
DESKTOP_ENUMERATE |
DESKTOP_HOOKCONTROL |
DESKTOP_JOURNALPLAYBACK |
DESKTOP_JOURNALRECORD |
DESKTOP_READOBJECTS |
DESKTOP_SWITCHDESKTOP |
DESKTOP_WRITEOBJECTS);
if (hDesktopLlx == NULL)
{
SECURITY_ATTRIBUTES sa;
sa.bInheritHandle = TRUE;
sa.nLength = sizeof(SECURITY_ATTRIBUTES);
sa.lpSecurityDescriptor = NULL;
hDesktopLlx = CreateDesktop("llx", NULL, NULL, DF_ALLOWOTHERACCOUNTHOOK,
DESKTOP_CREATEMENU |
DESKTOP_CREATEWINDOW |
DESKTOP_ENUMERATE |
DESKTOP_HOOKCONTROL |
DESKTOP_JOURNALPLAYBACK |
DESKTOP_JOURNALRECORD |
DESKTOP_READOBJECTS |
DESKTOP_SWITCHDESKTOP |
DESKTOP_WRITEOBJECTS,
&sa);
if(hDesktopLlx == NULL)
{
AfxMessageBox("create desktop failed!");
return ;
}
}
HWINSTA hwinsta = NULL;
hwinsta = OpenWindowStation("winsta0", FALSE,
WINSTA_ACCESSCLIPBOARD |
WINSTA_ACCESSGLOBALATOMS |
WINSTA_CREATEDESKTOP |
WINSTA_ENUMDESKTOPS |
WINSTA_ENUMERATE |
WINSTA_EXITWINDOWS |
WINSTA_READATTRIBUTES |
WINSTA_READSCREEN |
WINSTA_WRITEATTRIBUTES);
if (hwinsta == NULL)
{
return ;
}
if (!SetProcessWindowStation(hwinsta))
{
return ;
}
if(!SetThreadDesktop(hDesktopLlx))
{
char szError[256] = {0};
ltoa( (long)(GetLastError()) , szError, 10);
AfxMessageBox(szError);
}
SwitchDesktop(hDesktopLlx);
}
|
|
|
|
|
I want to generate a struct variable whose fields are determined at the run time. It could be one with 2 fields or one with 2000 different fields.
For example,
During one execution the requirement could be-
struct
{
char[30] name;
int salary;
float age;
}
And during another execution it could be-
struct
{
double a[100];
float b;
long c[200];
int d;
char e;
}
I'll be very grateful if somebody could help me out.
Gaurav Gumber
|
|
|
|
|
You could use a union:
union my_union_t
{
struct
{
char[30] name;
int salary;
float age;
}
struct
{
double a[100];
float b;
long c[200];
int d;
char e;
}
};
you'd have to fill the union with all possible configurations, so it's not really at run time, but I'm not really sure that's possible.
|
|
|
|
|
The path goes to Project->Settings->Debug->Program arguments.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi.
I want to display the text of the previous selected tree-item.
I handle the tvn_selchanging message:
OnSelchangedTreeview(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
TV_ITEM tvItem;
tvItem = pNMTreeView->itemOld;
AfxMessageBox(tvItem.pszText);
*pResult = 0;
}
But this does not work, gives me all kinds of weird characters.
Anyone knows what the problem might be?
Greetings
Jens
|
|
|
|
|
I don't believe itemOld is valid at that point. You could just store the text in a member variable everytime a selection is made.
OnSelchangedTreeview(NMHDR* pNMHDR, LRESULT* pResult)
{
AfxMessageBox(m_strOldSel); // show old one
m_strOldSel = pNMTreeView->itemNew.pszText; // set it for next time
}
|
|
|
|
|
In my Application I got a lot of options that the user can customize the application with.
The problem I got is that when the option dialog is close I need to tell ALL windows that options have been changed so they can re-read them.
So is there a way to send a message that is received by ALL windows??
/Mathias
|
|
|
|
|
Yes, but make sure that ALL windows care about what is going to be sent to them before blindly sending a "global" message.
SendMessage(HWND_BROADCAST, ...);
|
|
|
|
|
Hi all,
does anybody know what the exact syntax is for sending a CString variable with SendMessage? I have tried every thing you can imagine:
UINT MyThread(LPVOID arg)
{
HWND hMain = (HWND) arg;
CString text;
text = "Hello";
SendMessage(hMain, WM_SEND_HELLO, 0, (LPARAM &) text);
}
LRESULT CMyDlg::OnSendHello(WPARAM wParam, LPARAM lParam)
{
CString* text = (CString *) lParam;
return 0;
}
What is wrong with this code?
|
|
|
|
|
Try correcting your SendMessage to this:
SendMessage(hMain, WM_SEND_HELLO, 0, (LPARAM) &text);
Maybe you need a LPCTSTR cast for &text, if it doesn't compile.
|
|
|
|
|
It appears you want to send a pointer to a CString.
Wrong:
SendMessage(hMain, WM_SEND_HELLO, 0, (LPARAM &) text);
Right:
SendMessage(hMain, WM_SEND_HELLO, 0, (LPARAM) &text);
Personly I recommend sending the address of the string instead of the address of a CString object.
SendMessage(hMain, WM_SEND_HELLO, 0, (LPARAM)(LPCSTR)text);
Trust in the code Luke. Yea right!
|
|
|
|
|
Is it possible for someone to post me a proper visual C++ intergrated with Hp Openview?
I appreciate any help. Thank you.
|
|
|
|
|
I have one Proxy Display driver. I want to debug into it. How I will able to do that ?
|
|
|
|
|
Hi,
I am using LIBXML from www.xmlsoft.org[^].
To supprt our application for Japanese platform, we are encoding the strings to UTF-8 and then putting it into XML. We were using unicode build for that. So by default the strings were 'WideChars'. But in non unicode build the strings are 1 byte char strings.
My question is how do i encode the 1 byte char strings to uUTF-8 ??
I was using MultiByteToWideChar / Widechatto ... for encoding. But in this case how do i go @ it ??
My understanding on support of internationlization is not so strong. Any focus on concepts / ideas / solution to above problems will be of great help.
thanks and regards.
|
|
|
|
|
Hi, everyone!
I want to write a simple tool to analyze the log file
of IIS. I want to make a statistical report of the site.
For example, top 20 URLs of the site which is most popular.
Better with graphics.
I want to know whether there are already some free tools
already, better with source codes.
Thanks in advance,
George
|
|
|
|
|
How to enable a menu item dynamically. I have tried EnableMenuItem but with no success.
|
|
|
|
|
Use a flag, when you press a button on a dialog or something, set your flag to TRUE and in WM_INITMENU you check whether your flag is TRUE or FALSE and then use EnableMenuItem() to disable/enable/etc your item.
Is everything clear?
Rickard Andersson8
Here is my card, contact me later!
UIN: 50302279
E-Mail: nikado@pc.nu
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|