|
What's the plugin a plugin for? VS? Office? ...
|
|
|
|
|
the plugin is for VS. you can say that i have to use that plugin in an application written for VS
sAqIb
"Our scientific power has outrun our spiritual power. We have guided missiles and misguided men."
Dr. Martin Luther King Jr.
|
|
|
|
|
They hide that information in the documentation[^]
and please don't cross post.
led mike
|
|
|
|
|
I have a class containing these methods/members :
class CWorkerThread
{
public:
CWorkerThread(const HANDLE* hJobSignal);
~CWorkerThread();
private:
void run();
static DWORD WINAPI StaticThreadFunction(LPVOID lpParameter);
const HANDLE* m_hJobSignal;
};
The constructor creates a Thread and passes it the StaticThreadFunction to execute. As parameter it can now pass either a pointer to run(), or a the this-pointer. Wich is better ? I really see no big difference, but i fear i might miss some important point here.
Thanks !
|
|
|
|
|
I favor passing a pointer to 'this'.
Inside the static function, you cast the LPVOID to a 'this' pointer and then call the virtual function 'Run'.
Therefore, if someone dervies from your thread class, the static function will always call the 'Run' of the derived class. I am not sure of the behavior if you pass in the Run pointer directly, from the base class, not sure you would get the Run of the dervied class to execute.
My static thread runner functions typically have two lines in them:
DWORD WINAPI CWorkerThread::StaticThreadFunction(LPVOID lpParameter)<br />
{<br />
CWorkerThread* pRunner = (CWorkerThread*)lpParameter;<br />
return pRunner->Run();<br />
}
It really is that simple!
Any sufficiently gross incompetence is nearly indistinguishable from malice.
|
|
|
|
|
I have a combobox in which i have values
when i select a value and press button add, I add it to the list box
but I want to control this insertion i mean if i insert a value the second time he must don't accept it.
how can i do that
thank's
zizzzzzzzzzzz
|
|
|
|
|
Check whether value is already in the CB.
Greetings from Germany
|
|
|
|
|
Hi,
Use combox->FindStringExact(...) Api of the CB. if it is -1 then add the string if it gives any nuber greter than 0 then there is a string.
Good Luck.
Uday kiran
|
|
|
|
|
I think that you don't understand my question
i'll give you an exemple
my combo 0
1
2
3
when I select a value "0" for example and press the button ok it'll be added to the list. I want that when I select this value again it 'll not be added to the listBox because it's already exists.
i hope that my explanation is more clear
thank's
|
|
|
|
|
what's the problem
Uday kiran
|
|
|
|
|
I don't want to have in my listBox for example
0
1
0
0
you understand me ? the value 0 must figure one's
|
|
|
|
|
hi,
I told na use FistStringExact(...) api which detects the Duplicate Values in the ListBox.
//Code.........
int i = -1;
i = cb->FindStringExact("one"); // one is a String value you want to insert.
if(i == -1)
{
Cb->AddString("one");
}
else
{
MessageBox("Already Exist in the List");
}
// end of the Code
Whats the Problem.
Uday kiran
|
|
|
|
|
thank you this is what I want
|
|
|
|
|
zizzzz wrote: ...if i insert a value the second time he must don't accept it.
First check to make sure the listbox (not the combobox) does not already contain the item. If it does not, call AddString() .
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
yes David I did it and it's working like I want
thank's for you and for uday kiran janaswamy
|
|
|
|
|
Dear all
for one application I need to know which DMA and interrupt line is used by Paraller port I computer.
Do you have any idea about this.
Regards
Mahdi
|
|
|
|
|
I have the following code in my app..
CMultiDocTemplate* pDocTemplate2;<br />
pDocTemplate2 = new CMultiDocTemplate(<br />
IDR_TTOOLTYPE,<br />
RUNTIME_CLASS(CReportDoc),<br />
RUNTIME_CLASS(CChildFrame),
RUNTIME_CLASS(CReportView));<br />
pDocTemplate2->SetContainerInfo(IDR_TTOOLTYPE_CNTR_IP);<br />
AddDocTemplate(pDocTemplate2);<br />
<br />
CMultiDocTemplate* pDocTemplate1;<br />
pDocTemplate1 = new CMultiDocTemplate(<br />
IDR_TTOOLTYPE,<br />
RUNTIME_CLASS(CGraphDoc),<br />
RUNTIME_CLASS(CChildFrame),
RUNTIME_CLASS(CGraphFormView));<br />
pDocTemplate1->SetContainerInfo(IDR_TTOOLTYPE_CNTR_IP);<br />
AddDocTemplate(pDocTemplate1);<br />
<br />
CMultiDocTemplate* pDocTemplate;<br />
pDocTemplate = new CMultiDocTemplate(<br />
IDR_TTOOLTYPE,<br />
RUNTIME_CLASS(CTToolDoc),<br />
RUNTIME_CLASS(CChildFrame),
RUNTIME_CLASS(CTToolView));<br />
pDocTemplate->SetContainerInfo(IDR_TTOOLTYPE_CNTR_IP);<br />
AddDocTemplate(pDocTemplate);<br />
CMainFrame* pMainFrame = new CMainFrame;<br />
if (!pMainFrame->LoadFrame(IDR_MAINFRAME))<br />
return FALSE;<br />
m_pMainWnd = pMainFrame;
can ne one help me in getting buttons to control focusing of these views????
|
|
|
|
|
keyurbhatnagar wrote: can ne one help me in getting buttons to control focusing of these views????
The easiest way is to define your own WM_xxx message(s) and have the view's frame windows
send/post them to the main frame window or whichever window "contains" all the views.
If you have a more specific example of how you want to control focus then maybe I can post sample
code if you need it.
Mark
|
|
|
|
|
I want to make buttons on toolbar labeled 1,2&3 and use them to view these frames jst like the file list in window menu tab is used, it shows the windows that are opened and when u click on anyone it is focused and displayed on top. My application has only these 3 frames and no new document is to be made.
If you can give some sample code it would be great,
Thank you
|
|
|
|
|
I'm assuming you are using Doc/View MDI.
The first created MDI child window has id == AFX_IDM_FIRST_MDICHILD, second is
AFX_IDM_FIRST_MDICHILD+1, etc.
So, with only 3 child frames...
ON_COMMAND(ID_MYBUTTON1, OnButton1)
ON_COMMAND(ID_MYBUTTON2, OnButton2)
ON_COMMAND(ID_MYBUTTON3, OnButton3)
...
void CMainFrame::OnButton1()
{
CWnd *pWnd = GetDescendantWindow(AFX_IDM_FIRST_MDICHILD);
if (pWnd)
MDIActivate(pWnd);
}
void CMainFrame::OnButton2()
{
CWnd *pWnd = GetDescendantWindow(AFX_IDM_FIRST_MDICHILD + 1);
if (pWnd)
MDIActivate(pWnd);
}
void CMainFrame::OnButton3()
{
CWnd *pWnd = GetDescendantWindow(AFX_IDM_FIRST_MDICHILD + 2);
if (pWnd)
MDIActivate(pWnd);
}
|
|
|
|
|
Thnkx Man you have helped me a lot, actually i am a fresher only one week of exp so did'nt had the knowledge. You have to help me further as you did today
thanx once again....
|
|
|
|
|
Hi.
There is only one control in a dialog thats the Edit control. This is set as Multilined and read only. My problem is that whenever this dialog is hown the I beam cursor appears when the mouse is over the edit control.
I dont want this to happen as well the focus shouldn't be on the edit control.
Why i want this is because it should appear like a static control but with scrol bars.
Sunil
|
|
|
|
|
hi,
Use EditControl->SetFocus(-1);
May this solution may solve your problem.
Uday kiran
|
|
|
|
|
am using visual studio 2003.. so SetFocus doesnt take any parameters..
any other suggestion
Sunil
|
|
|
|
|
You can override CEdit::OnSetCursor(...) on the edit control to prevent the I-Beam cursor from being used and leave it as an arrow cursor.
You can override CEdit::OnSetFocus(...) to cause focus to automatically go to the next control - get the next control in the Z-Order and call SetFocus() on it (do not go to the previous control, otherwise tabbing through controls will not work correctly).
Note that if the user cannot focus the control, they might not be able to use the scrollbars.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|