|
|
Morning, all
the applicatin runs fine if I don't set any breakpoints. But if I set breakpoint in \MFC\SRC\DLGCORE.CPP
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);
it will stop after enter modal loop, the dialog said it's comlete, but program not exit out by automaticlly, the reason I set breakpoint was the (RunModalLoop(dwFlags) = 1 AND m_nModalResult =4 in another version.
Thanks
|
|
|
|
|
Is it possible one of them was retuning '1' because you pressed the OK button, which normally returns '1' from the dialog result? I am not sure where '4' came from. CANCEL is usually '2'.
|
|
|
|
|
I think you are right....4 could be the auto start.
Thank you!
|
|
|
|
|
I have been trying to modify Wolfram Steinke's ListBox Tutorial as I wanted to create a ListBox that allows Alpha/Index sorting plus using tabs to put the text into fields.
When I try to add the '\t' (which works in OnLoadList) to OnToggleListStyle, instead of the text fields being spaced out by tabs, I get them seperated by the vertical bar character.
What am I missing?
What should I be doing?
This tutorial is listed on Code Project
Charles
|
|
|
|
|
Are you using the LBS_USETABSTOPS style? You'll also want to use a monospaced font in the listbox so that the columns are properly aligned.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Doh! now you pointed it out, it seems so obvious.
Needless to say... I wasn't but I am now. Works great.
Thanks.
|
|
|
|
|
I have created an activeX in VC++ with the following Method
long ABC::OpenAVI( LPCTSTR strFileName )
I have included this active X in Microsoft Excel. Using VBA i am trying to access this function
DEF.OpenAVI(FileName) ----- where FileName is declared as a string and DEF is the name of my activeX
I keep getting type mismatch error. Can some one help me with this.
Thanks in Advance
M
|
|
|
|
|
I think when it comes to COM string variables, use the BSTR type. This will then be visible to VB and VBA as a standard String data type.
I Dream of Absolute Zero
|
|
|
|
|
Please correct me if I am wrong,BSTR is not an acceptable argument type, We can either have BSTR* or LPCTSTR.
|
|
|
|
|
TUMB wrote:
We can either have BSTR* or LPCTSTR
Then I would use BSTR*. In order for other language, and in this case, the VBA scripting language to recognise the datatype, it has to be of the VARIANT structure.
COM Strings are marshalled via the BSTR type; I think LPCTSTR are specific to C/C++.
I Dream of Absolute Zero
|
|
|
|
|
hi i m trying to select the multiple files through the file open dialog box for that purpose i used that code.
according to the MSDN to select multiple file the m_ofn.lpstrFile file ptr should pt to new buffer u had allocated. i had done that.
CFileDialog *object=new CFileDialog(TRUE,(LPCTSTR)"shp",NULL,OFN_ALLOWMULTISELECT,"Shape File |*.shp|",NULL);
char *filename;
object->m_ofn.lpstrFile= filename; // here it give the assertion.
object->m_ofn.nMaxFile=sizeof(filename);
if(object->DoModal()!= IDCANCEL)
MessageBox(object->m_ofn.lpstrFile,"ptr");
i want the file names that had been selected through file dialog. what to do.
ddd
|
|
|
|
|
I think you will need to allocate the input text buffer before use.
<code>
char filename[256]; <font color=green>
object->m_ofn.lpstrFile = filename;
object->m_ofn.nMaxFile = 256;
..
</code>
I Dream of Absolute Zero
|
|
|
|
|
tasleem143 wrote:
CFileDialog *object=new CFileDialog(...);
It is not necessary to involve the memory manager for this. Just use a simple stack-based variable and you'll have one less potential problem to deal with.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
hi i m trying to select the multiple files through the file open dialog box for that purpose i used that code.
according to the MSDN to select multiple file the m_ofn.lpstrFile file ptr should pt to new buffer u had allocated. i had done that.
CFileDialog *object=new CFileDialog(TRUE,(LPCTSTR)"shp",NULL,OFN_ALLOWMULTISELECT,"Shape File |*.shp|",NULL);
char *filename;
object->m_ofn.lpstrFile= filename; // here it give the assertion.
object->m_ofn.nMaxFile=sizeof(filename);
if(object->DoModal()!= IDCANCEL)
MessageBox(object->m_ofn.lpstrFile,"ptr");
i want the file names that had been selected through file dialog. what to do.
ddd
|
|
|
|
|
Use the CFileDialog::GetStartPosition() / CFileDialog::GetNextPathName() functions
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_mfc_cfiledialog.3a3a.getstartposition.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/_mfc_cfiledialog.3a3a.getnextpathname.asp
HTH
|
|
|
|
|
Hi All,
I have added Vertical Scroll bar to a Pop up dialog at design time.
However Scroll bar doesn't Scroll at run time.
I am adding controls to the dialog at run time.
As Control gets added and dialog size goes beyond screen size I am not able to scroll down and view the controls.
Kindly advise on this.
thanks
Sanjay
|
|
|
|
|
The builtin dialog handling does not support scrolling; you will need to scroll the dialog yourself. Look at the dialog section here on Code Project for ideas on how to do that.
Software Zen: delete this;
|
|
|
|
|
Is it possible to use Groups with a virtual list control?
The following line never results evaluates to true, which means I guess that the group id is not being requested?
if(pItem->mask & LVIF_GROUPID)
I am changing an exsiting list control that work in Non-Virtual mode and the groups work great, so I guess I am adding the group correctly.
How would I go about configuring the list control to request the Group ID / info.
Any ideas?
Cheers
AndyC
|
|
|
|
|
I want to use the assignement operator to get data from (CArray) that has items of type (CStringArray):
------------------------------------------------------------------------
CArray <cmstringarray,cmstringarray&> MyList;
CStringArray strArrMyStrArray1;
CStringArray strArrMyStrArray2;
strArrMyStrArray1.Add(TEXT("String11");
strArrMyStrArray1.Add(TEXT("String12");
strArrMyStrArray2.Add(TEXT("String21");
strArrMyStrArray2.Add(TEXT("String22");
MyList.Add(strArrMyStrArray1);
MyList.Add(strArrMyStrArray2);
/////////////////////////////////////////////////
CStringArray strArrMyOUTPUTStrArray;
strArrMyOUTPUTStrArray = MyList.GetAt(1); /// ERROR CStringArray doesn't support (operator = )
-----------------------------------------------------------------------
so; I inhereted the CStringArray (new class CMStringArray) and overladed the (=) operator:
-----------------------------------------------------------------------
CMStringArray& CMStringArray:perator= (const CMStringArray& InputArray)
{
int iCounter;
for( iCounter=0; iCounter
|
|
|
|
|
Dear All,
Can anybody let me know how to kill the running process (WINDOWS SDK)???
I am using the TerminateProcess() functionin which it requires the Handle of the process...How do I get the handle of process ??? Let me tell U,I am not getting the required Output by GetHandle() method...
Thanks in advance.
Supriya Tonape
|
|
|
|
|
Supriya Tonape wrote:
Can anybody let me know how to kill the running process
If you know the Name Of Window that Will Be Faily very Easy to kill that Window/Process.
First By Using FindWindow(...) find the handle of the Window then you can use WM_QUIT/WM_CLOSE message to close that window.
No need to use TerminateProcess in this case
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Thanks Alok!
But I didnt get why do I need to find window when I already wanted to kill the process of specific name.
Anyways but I got the solution, I did it using 'CreateToolhelp32Snapshot()' as it will return handle for snap shot of all running processes in system n further using 'Process32First()' and 'Process32Next()'
Anyways but thanks again for trying to help me.
Regards,
Supriya Tonape
|
|
|
|
|
Supriya Tonape wrote:
Anyways but I got the solution, I did it using 'CreateToolhelp32Snapshot()' as it will return handle for snap shot of all running processes in system n further using 'Process32First()' and 'Process32Next()'
Yeah you solution is very Nice! . you can try my way tooo.. here is a small example to enumerate all the visible window present on desktop!:-
http://alok.bizhat.com/site/tipandtrick.php?tiptype=2&tipid=30#30[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Supriya Tonape wrote:
How do I get the handle of process ???
How about EnumProcesses() , or the Process32First() /Process32Next() pair?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|