|
I know it's not supported with the Classwizard, but is there a way to tie a class function to several objects, and have a pointer to the "clicked" object passed to the function?
I have ten rows (exact copies) on a dialog form, and i'd like to have one univeral function for each column, instead of ten seperate functions for each object. If a pointer to this object was passed, I could easily do everything I need within this one function.
I've had this ability in other GUI packages. Maybe I'm just spoiled and this can't be done here. I'm just trying to streamline my code.
Any help is appreciated.
Todd Krzeminski
tkrzeminski@nlxcorp.com
|
|
|
|
|
Try ON_CONTROL_RANGE.
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
i have a socket client-server. some users are paid, some not.
i want to divide them into 2 group and give paid cust higher priority, can u give me some suggestions in tech?
thx
includeh10
|
|
|
|
|
presumably you are storing user_id type data in a db somewhere if people are paying to use the service so just include a field in the db that they paid and at logon set the priorities / act on the priorities when they connect
"... and so i said to him ... if it don't dance (or code) and you can't eat it either f**k it or throw it away" sonork: 100.18128 8028finder.com
|
|
|
|
|
I already asked there, but here it goes again:
I'm trying to use a link like
[a href="\\intranetfileserver\mailarchive\mymail.eml"]mymail[/a]
to open a mail saved as .eml in Outlook Express.
double-clicking the .eml file in Windows explorer does as it should (start OE, and open the .eml for viewing, the command line is msimn.exe /eml:%1)
Using a link in a web page (as given above) displays the mail body directly in IE (however, I can't access attachments etc.)
Where/how can I change this, to open the file directly in OE?
Currently, I can do that by registering "msimn.exe /eml:%1" as open command for a new file type .emlx, and reanming the e-mails (and links) accordingly. However this is tedious to setup at each PC and downloads the mail to a local folder (which I do not want)
TIA
Peter
You don't need to sleep to see a nightmare Anne Clark [sighist]
|
|
|
|
|
hello everybody
my requirements are as follows...
1) I want to run a C program in Vc++ so that it looks GUI
2) the output generated by my program is an excel file and i want to open thru my (which has to be made) in Vc++
3) I want to create Find files or folders with similar options in windows in my application...I can create a new one or can use the id of Find files which is ::{e17d4fc0-5564-11d1-83f2-00a0c90dc849}
plz tell me how to implement find in the application
can anyone plz help me to perform all these three functions in one application?? plz explain step wise as i am new to VC++
thanks
bye
|
|
|
|
|
hi,
To start with u can create a simple Dialog based application. You'll have to read MSDN for more information, for how to:Create a dialog based app". Then u can use Windows SDK funtions and MFC to do the rest. Like use CreateProcess / WinExec to open the .xls file. MFC provies a Find dialog class which is easy to use. Its very difficult to explain a step-by-step process. It would be better if u read MSDN on the said lines.
hope this helps,
Sharad Ganesh
|
|
|
|
|
Hi,
I want to get the path where the application is running...
The GetCurrentDirectory() (SDK function) is not what I want...
Thanks in advance...
Hello World!!!
from Raphaël
|
|
|
|
|
void TakePath(LPTSTR path, LPTSTR filename)<br />
{<br />
wcscpy(path,filename);<br />
TCHAR * p = path+wcslen(path);<br />
while(p>path){<br />
if(*p == '\\') break;<br />
p--;<br />
}<br />
*(++p) = '\0';<br />
}<br />
...<br />
TCHAR filename[121];<br />
GetModuleFileName(NULL, filename, 120);<br />
TakePath(path, filename);<br />
...
|
|
|
|
|
It would be better to use the system call to _splitpath:
char drive[_MAX_DRIVE] ;
char path[_MATH_PATH] ;
char filename[_MAX_FNAME] ;
char extension[_MAX_EXT] ;
source = "C:\some path\some_file.ext" ;
_splitpath(source, drive, path, filename, extension) ;
And if you don;t want a specific part of the split path, pass in NULL. For example, if you just needed the drive/path
_splitpath(source, drive, path, NULL, NULL) ;
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
Thanks for this answer...
Hello World!!!
from Raphaël
|
|
|
|
|
Hi guys,
I am new bee in MFC. I have to get the System details where I am running my program, I use GetSystemInfo() call for that but I couldn't get the details of the OS. Is there any call to get that? Please help. thanks.
bye
Prav
|
|
|
|
|
Hi guys,
I am nee bee in MFC. I have to get the System details where I am running my program, I use GetSystemInfo() call for that but I couldn't get the details of the OS. Is there any call to get that? Please help. thanks.
bye
Prav
|
|
|
|
|
|
I need to assume that this person doesn't know how to use GetVersionEx. The following example retrieves the current version of Windows.
OSVERSIONINFO vi;
WORD wWinVer;
vi.dwOSVersionInfoSize=sizeof(vi);
GetVersionEx(&vi);
wWinVer=MAKEWORD(vi.dwMinorVersion,
vi.dwMajorVersion);
Besides the major and minor version numbers, the version information returned by GetVersionEx includes the build number of the OS, identifies the running platform, and contains additional information about the Windows version installed.
Peter O.
|
|
|
|
|
Hi,
Please look into the code and reply my question
char *ptrChar;
ptrChar= new ch;
*ptrChar = 'c';
''
'' some logic here
''
ptrChar = NULL;
when I tried to use delete ptrChar,application is getting crashed but if I assign it to NULL application is not crashing , is this correct way of coding
Can anyone please explain
Thanks
Uday
|
|
|
|
|
'ch' is an unspecified type. Please repost what your code really looks like.
|
|
|
|
|
|
you should do this:
char *ptrChar;
ptrChar= new char;
*ptrChar = 'c';
''
'' some logic here
''
delete ptrchar;
Best regards,
Alexandru Savescu
|
|
|
|
|
use
ptrChar = new char
then
delete ptrChar
You should always delete what you create with new .
Setting ptrChar to NULL after deleting is good practice if you may use ptrChar later.
Jason Henderson quasi-homepage articles "Like it or not, I'm right!"
|
|
|
|
|
hi,
Assigning a pointer to NULL does not actually free the allocated memory. Your memory should have been allocated by using "new char". ch is not any type here. I presume it should have been "char". One very nice thing about delete is that even if the pointer = NULL, ur app _won't_ crash.
I just replace that new ch with "new char". and then
delete ptrChar;
Regards,
Sharad Ganesh
|
|
|
|
|
hi,
memory is allocated using new but still when I am trying to delete, it is getting crashed
Uday
|
|
|
|
|
hi,
Did u check up on the corrected code i posted ? There was a corection "new char".
Rgds,
Sharad
|
|
|
|
|
I have a CScrollView derived class that displays a child dialog containing various settings. Normally, when I scroll the contents, the child dialog moves with it. I overrode the following function to make the child hover.
void CMDITestView::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
if(m_hWnd&&m_lpCodeSettingsDlg!=NULL)
{
WINDOWPLACEMENT wndpl;
m_lpCodeSettingsDlg->GetWindowPlacement(&wndpl);
ClientToScreen(&wndpl.rcNormalPosition);
m_lpCodeSettingsDlg->ShowWindow(SW_HIDE);
CScrollView::OnVScroll(nSBCode, nPos, pScrollBar);
ScreenToClient(&wndpl.rcNormalPosition);
m_lpCodeSettingsDlg->SetWindowPlacement(&wndpl);
m_lpCodeSettingsDlg->ShowWindow(SW_SHOW);
}
}
With the ShowWindow calls it flickers when the child is redrawn, without it the window stretches when being redrawn, and it looks terrible.
Does anyone have any ideas about how to stop the flickering and/or stretching? The CMDITestView was created with WS_CLIPCHILDREN style.
Many thanks,
Alan Dugdall
|
|
|
|
|
I think you should override CMDITestView::OnEraseBkgnd. Instead of calling base class implementation, draw background yourself, excluding new dialog's area (see CDC::ExcludeClipRect), and return TRUE.
|
|
|
|