|
Hi everyone,
I am using VC++ 6. I have a 3 listcontrols which display different data. I have customized the list control for the look and feel by creating a class "CCustomListCtrl" .I have created 3 instances of "CCustomListCtrl" in CMainFrame. class which I am using notification message "NM_CLICK" to detect the click on the list. Now i want to identify which of the user has clicked.
|
|
|
|
|
chaitannya_m wrote: Now i want to identify which of the user has clicked.
There is an NMHDR structure that's given as parameter to the function. It contains a variable called hwndFrom which denotes the control from which the notification came. You can use this handle.
|
|
|
|
|
chaitannya_m wrote: class which I am using notification message "NM_CLICK"
Instead of handling the message in the CCustomListCtrl, handle that message in the CMainFrame itself. NM_CLICK is actually a notification. So handle the WM_NOTIFY message in the CMainFrame and check whether the code is NM_CLICK.
|
|
|
|
|
I guess you need to identify the list control which send the NM_CLICK notification message. NM_CLICK notification returns the id and handle to window of list control, this can be used to identify the control.
Best Regards
Raj
|
|
|
|
|
how to use the handle dude...i tried NMHDR ..it does give different values for the list, but how to identify which value is for what. Well i have to use the custom control for sure, its for different purpose. Also i can't use the click notification in the mainframe since i have listcontrols in different windows
|
|
|
|
|
chaitannya_m wrote: how to use the handle dude
I prefer to use ID than handle but no matters.
chaitannya_m wrote: i tried NMHDR ..it does give different values for the list, but how to identify which value is for what.
You need to store the values of ID when the list control is created and matching the value with which the NMHDR returns identifies the list control.
chaitannya_m wrote: Also i can't use the click notification in the mainframe since i have listcontrols in different windows
You can use message handlers in its parent window.
|
|
|
|
|
I have a stand alone application (messenger). I was asked to the messenger to have the fallowing possibility:
from a link with a phone number parameter to make a call in the application. If the messenger is not installed, to take the client to the official web site. If the product is installed to see if it is open. If it is open and the user is logged in to make the call.
My idea is the client to check the registry and see if the product is there, which solves the first part. If there are certain keys in the registry next step is from the processes to see if the product is active. If active somehow send instruction to call the function : CallNumber( phonenumber phnum)
Can you give me any leads on how to do all this, any other solution to the task?
The project is done in C++
Thank you very much
Dimkov Trajce
|
|
|
|
|
|
I am not sure where to post it, but the application is in C++ and I might need coding to make it work with inline commands
|
|
|
|
|
hi all
iam facing link error "unresolved externall symboll" while loading my dll explicitly, but it work i load implicitly, here i given the sample by which i tryed, and i defined all the virtual function in the derived class, which in the base class
#include "stdafx.h"
#include "windows.h"
int main(int argc, char* argv[])
{
typedef UINT (CALLBACK* LPFNDLLFUNC1)(DWORD,UINT);
HINSTANCE hDLL; // Handle to DLL
LPFNDLLFUNC1 lpfnDllFunc1; // Function pointer
UINT uParam2, uReturnVal;
DWORD dwParam1;
//HMODULE dll_module = LoadLibrary("./../TestDll/Debug/TestDll.dll");
hDLL = LoadLibrary("./../TestDll/Debug/TestDll.dll");
if (hDLL != NULL)
{
lpfnDllFunc1 = (LPFNDLLFUNC1)GetProcAddress(hDLL,
"MyAbsFunc1");
if (!lpfnDllFunc1)
{
// handle the error
FreeLibrary(hDLL);
return 0;
}
else
{
// call the function
uReturnVal = lpfnDllFunc1(dwParam1, uParam2);
}
}
return 0;
}
can any one help to solve this link error
|
|
|
|
|
you have to specify the lib name in the project setting. or atleat put
#pragma comment(lib, "./../TestDll/Debug/TestDll.lib") in your code.
|
|
|
|
|
Sivakumar R wrote: iam facing link error "unresolved externall symboll"
What's the symbol?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
Hi All
I have to application and one Application is writing something in file and another one is reading from that file. And i used FindFirstChangeNotification but it is working some time and some time it is not working so i want to use create mutex for this communication and i am very new in Mutex and tried my level best to achive but count not carck.
can any one help, How will i use MUtex.
Thank In advance
RYK
|
|
|
|
|
Hi,
So called "named Mutexes" can be uses between processes. So in this case give the Mutex the name of the File yout are using. But be careful, i think backlashes don't work with mutexes, so you should replace backslashes with some other character.
cu
a.
i know nothing
|
|
|
|
|
Hi,
just found some code that might help you:
HANDLE GetMutex()<br />
{<br />
CString Key = m_FileName;
Key.Replace('\\', '_');<br />
<br />
HANDLE hMutex = ::OpenMutex(SYNCHRONIZE, TRUE, Key);<br />
<br />
if (!hMutex) {<br />
SECURITY_ATTRIBUTES sa;<br />
<br />
sa.nLength = sizeof(sa);<br />
sa.lpSecurityDescriptor = NULL;<br />
sa.bInheritHandle = TRUE;<br />
<br />
hMutex = ::CreateMutex(&sa, FALSE, Key);<br />
}<br />
<br />
return hMutex;<br />
}
cu.
a.
i know nothing
|
|
|
|
|
|
hi i have to disable UAC in vista while running my application and at last i have to enable it. how to do this in vc++. im a new bie to vista. pls help me
|
|
|
|
|
You have a non Vista compliant application. I advise you to read and Michael Dunn's articles about Vista here at CP.
If you really need "Admin stuff" in your app, you have to redesign it so, some buttons have a shield icon and start an Real Admin exe.
Greetings from Germany
|
|
|
|
|
You can turn UAC off for a particular user but not switch it on and off willy nilly like you’re after.
Steve
|
|
|
|
|
Is this a good tip? I dont believe so.
(I answered him to)
Greetings from Germany
|
|
|
|
|
Hi all,
How would one go about using the delete command when working with AnsiString?
I have tried:
AnsiString Test;
...
delete [] Test;
But received this error: [C++ Error] E2157 Deleting an object requires exactly one conversion to pointer
operator.
Can anyone help me?
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
AnsiString Test;
is'n allocated dynamically, so you don't need to delete it;
Even it's allocated dynamically via AnsiString *str = new AnsiString("test");
you only need to delete it via "delete str" and not via "delete[] str"
Regards
|
|
|
|
|
|
I have read this article:Memory leaks in C++ and how to avoid them[^] , and it stated the following:
A memory leak is what happens when you forget to free a block of memory allocated with the new operator
or when you make it impossible to do so.
So can I assume that that one only free's a block of memory when the new operator was used.
i.e.
char *string;
string = new char[20];
delete [] string;
char *tString = "this is a test; // is it nessacery to delete this pointers memory??
Many Thanks
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Programm3r wrote: So can I assume that that one only free's a block of memory when the new operator was used.
i.e.
Programm3r wrote: char *tString = "this is a test; // is it nessacery to delete this pointers memory??
You can assume so, compiler allocated memory for constant string and let the compiler free's it.
|
|
|
|