|
Hi,
what problem in this code.
//function call
m_hThread1 =(HANDLE)_beginthreadex (NULL,0,RequestProcess1,NULL,0,&m_dwThreadId1);
/fucntion
unsigned __stdcall CIFakerDlg::RequestProcess1(void *dummmy)
{
statements
}
i got the following error
error C2664: '_beginthreadex' : cannot convert parameter 3 from 'unsigned int (void *)' to 'unsigned int (__stdcall *)(void *)'
None of the functions with this name in scope match the target type
any one help tome. thanks in advance.
Murali.M
|
|
|
|
|
Make the RequestProcess1 as static function. Refer the SDK.
The _beginthread is declared as
unsigned long _beginthread( void( __cdecl *start_address )( void * ), unsigned stack_size, void *arglist );
Mahesh
|
|
|
|
|
I have created an activeX control, in which i added a property page whom based class is COlePropertyPage. Everything is all right. In the next step, i want to show my property page as a simple CDialog. As the based class of the COlePropertyPage class is CDialog, i thought to write the following :
CMyPropPage dlgProp;<br />
dlgProp.DoModal();
But it didn't go well.
Could you please help me.
|
|
|
|
|
Without seeing any code it's impossible to answer.
Are you using the right thread ID? Does the thread have a message queue? Are you processing messages from the queue?
--Mike--
Ericahist | CP SearchBar v2.0.2 | Homepage | 1ClickPicGrabber New v2.0! | RightClick-Encrypt
You cannot truly appreciate Dilbert unless you've read it in the original Klingon.
|
|
|
|
|
Do you use the ON_THREAD_MESSAGE macro with the right parameters and handlers?
Try this @ home. (B&B)
|
|
|
|
|
Can I retrieve a pointer to the listbox of a combobox in CBS_DROPDOWNLIST style?
I'd like to change the dropped rect, but unfortunately there is no SetDroppedRect().
Toon
|
|
|
|
|
If you want to change the size of the listbox when we click the dropdown button of the combobox at design time, the solution is below.
1. First doubleclick the dialog from the resource view.
2. Then select your combo box.
3. Now click on the dropdown button on the combobox.
4. Then resize the selection (drag baseline of the selction rectangle) and that will be the size of the listbox.
isn't it simple?
Regards,
Jijo.
________________________________
Yesterday is history,
Tomorrow is a mystery,
But today is a present.
|
|
|
|
|
You can change the width and height of the dropdown listbox with following two functions in CComboBox.
to change the dropdown list width
to the longest string in the combobox
<br />
extern CComboBox* pmyComboBox;<br />
<br />
CString str;<br />
CSize sz;<br />
int dx=0;<br />
CDC* pDC = pmyComboBox->GetDC();<br />
for (int i=0;i < pmyComboBox->GetCount();i++)<br />
{<br />
pmyComboBox->GetLBText( i, str );<br />
sz = pDC->GetTextExtent(str);<br />
<br />
if (sz.cx > dx)<br />
dx = sz.cx;<br />
}<br />
pmyComboBox->ReleaseDC(pDC);<br />
<br />
dx += ::GetSystemMetrics(SM_CXVSCROLL) + 2*::GetSystemMetrics(SM_CXEDGE);<br />
<br />
pmyComboBox->SetDroppedWidth(dx);<br />
Change the each item height of dropdown list to 50px
<br />
extern CComboBox* pmyComboBox;<br />
<br />
CString str;<br />
CSize sz;<br />
int dx=0;<br />
CDC* pDC = pmyComboBox->GetDC();<br />
for (int i=0;i < pmyComboBox->GetCount();i++)<br />
{<br />
pmyComboBox->SetItemHeight( i, 50 );<br />
}<br />
pmyComboBox->ReleaseDC(pDC);<br />
<br />
<br />
greatest thing is to do wot others think you cant suhredayan@omniquad.com
|
|
|
|
|
Thx a lot for helping.
But what heppens when the strings are so long the can't be fully displayed and the horizontal scrollbar needs to be shown?
Answer : in case of 1 item there is an invisible scrollbar,
in case of 2 items, the scrollbar covers the second item
in case of more items, it looks nice and correct.
In the first two cases the solution with a horizontal scrollbar does not look nice, so I thought to resize the listbox in height but you cannot because c++ itself does resize the listbox to the number of items in the list without taking the size of a horizontal listbox into account.
Can I prohibbit this automatic sizing?
and again, Thx for helping
Toon Schellinck
|
|
|
|
|
Hi.
I try to create an ActiveX control (VC 6.0 FullControl) and i want to control size of my ActiveX control both in design mode and run time,to do it i override
IOleObjectImpl::SetExtent(...) method .But when i draw my control in design time (in resource editor) it have one size (SIZE* psizel param)but when i execute my application in run time it has another size.Please help.
Tanks.
|
|
|
|
|
Hi
I would like to know how to make a toolbar button toggle. For example, in MDI if there are two child windows and corresponding buttons on the toolbar for them, if the button is clicked once then the child window should appear and when it is clicked for the second time the child window should dissappear. Please help me regarding this. This is urgent.
Thanking you,
Regards
Ruchit Sharma. R
|
|
|
|
|
|
hi,
what problem in the following code. when i select new folder i got error. application is closed. i test i release mode. any one help to me.
CString m_strFolderPath;
LPMALLOC pMalloc = NULL;
LPITEMIDLIST pidl = NULL;
BROWSEINFO bi;
ZeroMemory(&bi, sizeof(BROWSEINFO));
// set the bi's default values
bi.hwndOwner = m_hWnd;
bi.lpszTitle = _T("Current folder is:");
bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_STATUSTEXT;
//bi.lpfn = BrowseCallbackProc;
pidl = SHBrowseForFolder(&bi);
if(pidl != NULL)
{
SHGetPathFromIDList(pidl,
m_strFolderPath.GetBuffer(
m_strFolderPath.GetLength()));
UpdateData(FALSE);
// free memory
if(SUCCEEDED(SHGetMalloc(&pMalloc)) && pMalloc)
pMalloc->Free(pidl);
pMalloc->Release();
m_EditPath.SetWindowText(m_strFolderPath);
}
thanks in advance.
Murali.M
|
|
|
|
|
When you get a buffer for the path with GetBuffer() , you need to specify a buffer size to allocate. At the moment, the string is empty, so GetLength() returns 0, so your buffer is 0 characters long. Allocate at least MAX_PATH characters and you should be ok. You also need to release the string buffer after.
CString m_strFolderPath;
LPMALLOC pMalloc = NULL;
LPITEMIDLIST pidl = NULL;
BROWSEINFO bi;
ZeroMemory(&bi, sizeof(BROWSEINFO));
bi.hwndOwner = m_hWnd;
bi.lpszTitle = _T("Current folder is:");
bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_STATUSTEXT;
pidl = SHBrowseForFolder(&bi);
if(pidl != NULL)
{
SHGetPathFromIDList(pidl, m_strFolderPath.GetBuffer(MAX_PATH));
m_strFolder.ReleaseBuffer();
UpdateData(FALSE);
if(SUCCEEDED(SHGetMalloc(&pMalloc)) && pMalloc)
{
pMalloc->Free(pidl);
pMalloc->Release();
}
m_EditPath.SetWindowText(m_strFolderPath);
}
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hi Ryan,
Thanks for ur valuable comment.
Have A Nice Day!
Murali.M
|
|
|
|
|
In CreateProcess what shld be first and 2nd parameter, so that whole computer is searched for executable file say ypager.exe file.
|
|
|
|
|
1. The first parameter of the CreateProcess is the filename of the exe that you want to execute.
2. The second parameter is the commandline arguments (if any) that you wish to pass to the executable.
The createProcess wont search the whole system when you give a filename. It just execute the exe file that you specify by the first parameter.
if you need to run an executable that located somewhere in the system, use CFileFind class and its FindFile () and function to search the system for that file and then get the filepath using appropreate functions and then give it as the first argument of CreateProcess ().
Isn't it simple ?
Regards,
Jijo.
________________________________
Yesterday is history,
Tomorrow is a mystery,
But today is a present.
|
|
|
|
|
|
Hi,
Why is my application showing illegal operation when i try to save a document created using CreateNewDocument().
It is an MDI application with Full Server option selected in Step 3 of AppWizard and Base class as CFormView. The base class for the document is COleServerDoc.
Other than using CreateNewFrame() and InitalUpdateFrame()what all should be added?
regards
kevcs2.
|
|
|
|
|
I want to open a new document on selecting a menu item.For this I used pDocTemplate->OpenDocument().Then I set a boolean variable, pDoc->m_bBool = TRUE; But in the LButtonDblClk() I get the variable GetDocument()->m_bBool as FALSE.Why is this so?
regards
kevcs2.
|
|
|
|
|
Have you tried setting a breakpoint on the varaibles to see if its being changed anywhere?
To do this, get the address of your m_bBool and enter it into the Breakpoints Data page as
*(int*)(0xaddress)
Set the elements to 1, and you shoudl get a BP set when the varaible is changed.
Roger Allen - Sonork 100.10016
Roger Wright: Remember to buckle up, please, and encourage your friends to do the same. It's not just about saving your life, but saving the quality of life for those you may leave behind...
|
|
|
|
|
I need to load a bitmap file which is created at runtime on a dialog...how do i do it...?
|
|
|
|
|
To load the bitmap from a file at runtime, please use the code
HANDLE handle = LoadImage( AfxGetInstanceHandle(),
"filname.bmp",
IMAGE_BITMAP,0,0,LR_LOADFROMFILE);
CBitmap* pBmp = CBitmap::FromHandle((HBITMAP)handle);
Now you loaded the bitmap from the file and you got a pointer of CBitmap class. And its now ready to use.
Isn't it simple ?
Regards,
Jijo.
________________________________
Yesterday is history,
Tomorrow is a mystery,
But today is a present.
|
|
|
|
|
Hi...
ThankYou for a valuable suggestion...how should i add that bitmap to a dialog..I used LoadBitmap() in OnInitDialog()...but its not working....
|
|
|
|
|
Use a CStatic control and use the SetBitmap() method.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|