|
Depends on compile settings[^]. If you choose to dynamically link CRT in all your modules (exe and dlls), it will be shared between them and it is safe to pass objects between modules.
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
|
Give me some code sample.
Thanks
ALL THINGS ARE POSSIBLE UNTIL THEY ARE PROVED IMPOSSIBLE-AND EVEN THE IMPOSSIBLE MAY ONLY BE SO,AS OF NOW
|
|
|
|
|
Hi,
Create the accelerators for the toolbar buttons using the resource editor...
Vikram Kashyap
"You will never fail until you stop trying"
|
|
|
|
|
Hey thnaks for ur reply.i tried this. but it is not working. after adding accelerator key.should i write some code to catch that message.
ALL THINGS ARE POSSIBLE UNTIL THEY ARE PROVED IMPOSSIBLE-AND EVEN THE IMPOSSIBLE MAY ONLY BE SO,AS OF NOW
|
|
|
|
|
Hi,
Yes, you need to load that Accelerator table.
HACCEL gAccel; //Declare in header file
//Add this code to the OnInItDialog of your dialog class
gAccel = LoadAccelerators(AfxGetApp()->m_hInstance,MAKEINTRESOURCE(IDR_MYACCEL));
//Add this code to PreTranslateMessage
if(TranslateAccelerator(AfxGetMainWnd()->m_hWnd,gAccel,pMsg))
return FALSE;
This should work....
Thanx and Bye
Vikram Kashyap
"You will never fail until you stop trying"
|
|
|
|
|
Hie Friends,
I am having one console kind of applicaion , Want to debug it during run time. It should ask or through a dialog box whenever exception occures(Here I am directly running exe ..not thr MSDEV)..I think it's possible thr CRT library but don't know how?
|
|
|
|
|
_asm int 3
this shows the dialog box to select the debugger you want. Is this wot you are looking for ?
There is no spoon.
mail
|
|
|
|
|
Yes , IT works. thanx.
_CrtDbgBreak() also useful.
|
|
|
|
|
I want to send enter key to device.
What I use function ASCII 13 to char.
Please guide me
|
|
|
|
|
something like
char ch = 0x(char value in hex);
Bryce
---
To paraphrase Fred Dagg - the views expressed in this post are bloody good ones.
--
Publitor, making Pubmed easy.
http://www.sohocode.com/publitor
Our kids book :The Snot Goblin
|
|
|
|
|
I am looking for strategies for using tree controls. The goal is to extend the CTreeCtrl (or maybe even build a new custom CWnd descendant tree control) in a way that makes it easy to use, and that hides away most of the uggly struct and message tweeking needed.
At init I would want to add one single node, the root, to the tree control. And as user expands nodes, the tree would ask the node to list its children. For the tree to be able to ask nodes for children, we need some kind of "class ITreeNode" interface. Implementing this interface would enable an object to be represented as a node in the tree. And the object would itself be in charge of how it should be represented in the tree.
The tree this way visualizes the object structure in memory, which is a fair approach imo.
The treenode interface could look something like this...
class ITreeNode<br />
{<br />
virtual CString GetTreeLabel() { return "Default"; }<br />
virtual void GetTreeChildren( CTreeNodeList& L ) {}<br />
virtual int GetTreeImage() { return 0; }<br />
virtual int GetTreeImageSelected( return GetTreeImage(); }<br />
}
Did anyone experiment with anything like this?
|
|
|
|
|
Hi,
I have some problem with the tooltip control. I have enabled the tooltip control for my DialogBOx. I have drawn little boxes on to my Dialog Box. On each Box I have given different Tooltip Text in WM_MOUSEMOVE. Every thing is working fine but in some places Tooltip is blinking. I mean text is appearing and disappearing very fastly. But in other places on Dialog Box tool tip is stable. Can any one tell me What is happening ?
Thanks & Regards,
Deliver
If you have faith in the cause and
the means and in God, the hot
Sun will be cool for you.
|
|
|
|
|
Hi,
R u using the RelayEvent(pMsg) in the dialog's PreTranslateMessage, if so then check the rect size for that particular control which is blinking with the one which you would have used while creating the tooltip using the AddTool function. Have a look @ CPropertySheet::GetTabControl @ msdn, it does have an example on using the tooltip control
Sujan
|
|
|
|
|
Hi,
Here i am providing the steps
In Dialog's header add
CToolTipCtrl tooltip;
in Dialog's on initdialog add
tooltip.Create(this,TTS_ALWAYSTIP);
CWnd *pWnd = GetDlgItem(IDC_BUTTON_BC1);
tooltip.AddTool(pWnd,"Hello Testing ",NULL,NULL);
Add the PreTranslateMessage for the dialog and add the following code
tooltip.RelayEvent(pMsg);
This will work. I think you shouldn't you on mouse move
Sujan
|
|
|
|
|
Hai frens. . .
I am facing a prblm in SDI.
My SDI will be in maximized state initially. . .
So, i do like this. . ShowWindow(SW_MAXIMIZE).
After that i want that maximize button disabled so i remove the style WS_MAXIMIZEBOX. IF i do so the SDI will be maximized initially but it becomes MOVABLE. How to handle this. . .I need it to be immovable.
Plz help me with this prblm
Tanx
|
|
|
|
|
Hello,
You can simply take the handle of the SystemMenu using GetSystemMenu and remove the Move menu. The code goes like this...
void CMainFrame::DisableMoveWindow()
{
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
pSysMenu->RemoveMenu(1, MF_BYPOSITION);
}
}
Call this function in the OnCreate of CMainFrame()
Vikram Kashyap
"You will never fail until you stop trying"
|
|
|
|
|
Thanx Vikram prblm solved. .
|
|
|
|
|
Thanx Vikram prblm solved. . .
|
|
|
|
|
I'm have a program with muti-threads,it's handles is increasing continually,how to find handles belong to thread or process?Do you have a tool?Thanks a lot!
|
|
|
|
|
|
Read a string from a file and wirte to a oracle's database,but display a incorrect string,help me !!Thanks
|
|
|
|
|
If you want to stick to APIs, you call MultiByteToWideChar() to go from ANSI to UTF-16, then WideCharToMultiByte() to go back to UTF-8.
--
I'm Michael Dunn and I approve this post.
Vote Trogdor in oh-four!
|
|
|
|
|
Hi,
I am developing a dll in C and I have one problem that I don't know how to solve...
An external application invokes my dll by calling the function:
int calculateParameters(int, int)
I need to return to the application the value "OK" indicating that the passed parameters are correct as soon as possible, and then do the needed calculations and pass the result of the calculations to the external application using a callback function.
How can I do so that after the function returns "OK", the previously created thread could continue alive and do the appropiate calculations and invoke the callback funtion?
Here is the simplified code of this dll:
// Function invoked from the external application
int calculateParameters(int a, int b)
{
_beginthread(sumParameters, 0, valorTmp); //Create a thread to calculate
if (a > b) return OK; //As soon as this function returns, the thread previously created is stopped and no calculation is done
}
//Function needed to perform the internal calculations
void sumParameters(void *valorTmp)
{
z = a + b; //Example of calculations
Callback(y); //Pass the result of the calculations to the external application
}
Thank you very much for your help
|
|
|
|
|
Hi All,
I am working with a CDialog object that opens three other dialogs using a tab control. I seem to be getting stuck trying to pass commands back to the main dialog so they can be sent to the comm port all together.
How can i either trigger an event handler from the tabbed dialog into my main dialog or change variables and call functions in my main dialog from the three dialogs that are created by the first.
I have tried right clicking on buttons and controls on my tabbed dialogs and adding event handlers to the main dialog but they do not seem to give a responce. Is there any code that i should add to get the main dialog to recognise an event that is not triggered by the dialog that it directly creates?
Any help would be great.
Geoffreyhunter
|
|
|
|