|
anuhoho wrote: and my dll is working in the background
You need to understand that a dll cannot work independently, it is merely a library of subroutines called by an executable program.txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
My problem is my dll is getting attached to one of the processes which I dont know so its difficult for me to trace.Is there some solution or remedy to my problem
|
|
|
|
|
anuhoho wrote: Is there some solution or remedy to my problem
The only thing that comes to mind is that your design needs reviewing. I have no idea what your dll is supposed to do, but if it is necessary for it to know when the system is being shut down then I suspect it contains some functionality that does not belong in a dll.txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
Let me explain a bit what i am doing. We have a MapiRule example in one of the SDks(Windows MObile 6.0 SDK)where we are setting a rule of collecting the sms somewhere else apart from the default inbox.. This is the application which I am modifying a bit. Now when I install this dll in the device its get attached to one of the process(of which I have no idea)and starts working at the background. Now I want that this dll which is running at the background should be able to get a keymessage event(or a stylus event) and do something...but Suppose I am switching the device off then i want that a message box will pop up..something of that sort.
Now if you got some idea will you be able to help me out.
Thanks in advance!!!
|
|
|
|
|
anuhoho wrote: Now when I install this dll in the device its get attached to one of the process(of which I have no idea)and starts working at the background.
That would seem to be the first issue you need to resolve. If you do not know who is using your library then how can you expect to control it?
As I said before, your design needs to be looked. This functionality belongs in an application not in a dll.txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
Hi,
I am doing Interprocess communction between and C console program an MFC Win32 program
seems like the fastest way of sending data is using WM_COPYDATA
Since SendMessage is not asyncournos
I was wondering I can use this message (for IPC) with PostThreadMessage or PostMessage
thankx
|
|
|
|
|
You cannot use WM_COPYDATA with PostMessage , for the very reason that the operation needs to be synchronous (the data being copied should be still in place).
You could consider sending this message from within a worker thread, so your GUI won't be affected.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
I understand thankx so much
|
|
|
|
|
You could use the Shared Memory
to allocate and set it at the first side
and then - just post an event at the second side...
I would use the COM transfer instead Check your definition of Irrationality[ ^]
1 - Avicenna
5 - Hubbard
3 - Own definition
|
|
|
|
|
not familar with com transfer but will look it up
|
|
|
|
|
PostMessage is for (MFC) Windows-GUIs
PostThreadMessage is for threads with a message queue
The shared data idea is really fine. It dimishes uneeded allocating and copying of memory.
allocate shared data and post user message when new data has arrived. Use an array and a flag which data has been read.Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Have the data in shared memory (used by both process)
and post a user message
thankx
|
|
|
|
|
you need to know that the data is read and nw can be sended. Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
That is a bad idea.
If you need it sent asynchronously, use a separate thread for this, within which use either SendMessage or SendMessageTimeout - I use both depending on the configuration parameters for timeouts.
|
|
|
|
|
Hello,
I was wondering if anyone knows a way to draw a PNG on a Cbutton with Vista Style applied that does not flicker?
Regards
|
|
|
|
|
Could you post the code
that provides the flickering ? Check your definition of Irrationality[ ^]
1 - Avicenna
5 - Hubbard
3 - Own definition
|
|
|
|
|
Not sure how you are trying to do. Does this[^] article help.
-Saurabh
|
|
|
|
|
Ok so here is the code that I use:
- some init stuff
void MyButton::LoadImageFile()
{
CRect rectBtn;
GetClientRect(&rectBtn);
dc.Attach(this->GetDC()->m_hDC);
Gdiplus::GdiplusStartupInput gdiplusstartupinput;
Gdiplus::GdiplusStartup(&m_gdiplusToken,&m_gdiplusstartupinput,NULL);
m_MyImage = Image::FromFile(L"c:\\icon.png",TRUE);
rect = Rect(rectBtn.left,rectBtn.top,rectBtn.right,rectBtn.bottom);
grpx = new Graphics(dc);
}
- Drawing in OnPaint()
void MyButton::OnPaint()
{
CButton::OnPaint();
grpx->DrawImage(m_MyImage, rect);
}
- Message Map
BEGIN_MESSAGE_MAP(MyButton, CButton)
ON_WM_CTLCOLOR()
ON_WM_PAINT()
ON_WM_LBUTTONDOWN()
ON_WM_LBUTTONUP()
ON_WM_ERASEBKGND()
END_MESSAGE_MAP()
- OnCtlColor
HBRUSH MyButton::OnCtlColor(CDC* pScreenDC, CWnd * wnd, UINT nCtlColor)
{
return NULL;
}
- OnEraseBkgnd
BOOL MyButton::OnEraseBkgnd(CDC* pDC)
{
return TRUE;
}
Image flickers when the focus is set on the button and glowing vista effect is applied or seldom when you fast move over the button with the image.
|
|
|
|
|
HI all,
please help me to find out all serial com port of machine.
give me any help or guidance for this.
thanks in advance.
|
|
|
|
|
|
See here."One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
I m already taking help of this article.
but i have some problem in this code.
i m using this code to find Ports.i m using "UsingWMI" to find out the ports,and place this code in Thread,i m start the thread on function OnInitDialog than enter the port details in List and the Combobox.
when port finding process is running if i terminate the thread,and again want to find out the ports its not done,
coinitializesecurity returned error 80010119.
i m terminate the thread because i have an option of stop searching for ports.
so please help me what can i do.
thanks in advance.
|
|
|
|
|
Le@rner wrote: coinitializesecurity returned error 80010119.
Have you tried this?"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Haven't you learned how to use Google yet? txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
In a simplicistic approach you may just try to open ports iteratively. The call will fail on not available ports (i.e not existing or busy ones).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|