|
I have been doing some troubleshooting and found that when it sends the kill CString to the receiving app the string contains garbage along with the string.. Here is the code I use to send the string to the other app. Any ideas on how to remove the garbage?
Btw, the m_strKill is the name of the other window and the string being sent for the kill command..
UpdateData(TRUE);
LRESULT copyDataResult;
CWnd *pOtherWnd = CWnd::FindWindow(NULL, m_strKill);
if (pOtherWnd)
{
COPYDATASTRUCT cpy;
cpy.dwData = 0;
cpy.cbData = m_strKill.GetLength();
cpy.lpData = (void*)m_strKill.GetBuffer(cpy.cbData);
copyDataResult = pOtherWnd->SendMessage(WM_COPYDATA,
(WPARAM)AfxGetApp()->m_pMainWnd->GetSafeHwnd(),
(LPARAM)&cpy);
m_strKill.ReleaseBuffer();
}
else
{
MessageBox("Can't find "+m_strKill);
}
UpdateData(FALSE);
Thanks,
Mike
|
|
|
|
|
I always go GetLength + 1 in order to allow for a NULL terminator. Sounds like that is what you need - your string keeps going until a NULL occurs in memory after your string's data.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
That was the ticket! Thanks alot Christian!
Mike
|
|
|
|
|
Hi
Does anyone know how can I acces the printer port from win2000?
Thanks;
xxx
|
|
|
|
|
I try to send information of a primary snapIn (Per example, number of nodes or name of each node of primary snapIn ) towards a extension SnapIn but I don't understand really how it works.
I believed to understand that it was necessary to use the interface IDataObject to communicate between Primary and Extension SnapIn but documentation on this matter are vagueness or non-existent
Thanks for you help
|
|
|
|
|
Hi everyone!
Does anyone know how to write a CTransInPlaceFilter derived filter which
works better then the NullNull filter sample in DirectX8 SDK .
My main problem is that when I resize the frame window the video window is not
allways resized . This fenomena occurs when I'm trying to increase the size
of the original frame . The frame is resized but the the video size is
constant.
Thanks
xxx
|
|
|
|
|
Is there a way to disable the 'click' sound the browser object makes when it begins loading a page?
CD
|
|
|
|
|
Hi all,
Bit of a newbie question I think, I've got an MDI app. and I've created several different views using CSplitterWnd (to make an Explorer style interface), when an item is double clicked in the CListView I want to Expand the TreeView item that is highlighted. But I can't seem to get a pointer to the TreeView object. How do I do this?
My best "work-around" so far is to save the TreeView CWnd as a variable in my document class and access it from there. Does that sound naff?
TIA
Jon.
|
|
|
|
|
Hi everybody,
how can i close an application through my application.
I launch outlook -with shellexecute- somewhere within my code and want to close it after finishing with it...Is it possible? if(possible) How?
thanks in advance
with greetings from germany
Özgür
|
|
|
|
|
You need to execute the application with CreatProcess() Function, then close the application with TerminateProcess() function.
Cheers!!!
Carlos Antollini.
|
|
|
|
|
Hi,
I'm currently working on a thumbnail viewer, which displays a large
number of thumbnails.
How do i implement smooth scrolling of all the thumbnails???
Any Ideas, tips or answers would be great.
Cheers
Will
|
|
|
|
|
1. create a DC (CreateCompatibleDC)
2. create a bitmap (CreateCompatibleBitmap)
3. select that bitmap to the DC (SelectObject)
4. copy the screen to the bitmap (BitBlt)
5. copy the bitmap to the screen, offset by the scroll amount (BitBlt)
6. clean up
-c
------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|
|
I Already use a memory device conntext the size of the screen and offset it for the scrolling.
The problem comes when the ammount of thumbs are to large for the Memory Device context.
To actually display all the thumbs, when the scrolling reaches the end of the Memory DC, I offset the DC again and draw the next set of thumbs.
This works and I can see all the Thumbnails but is rather messing when scrolled fast.
(i.e. NOT SEAMLESS)
What I am looking for it a way to enable smooth scrolling for an unlimited amount or Thumbnails.
Any Ideas? ANYONE
|
|
|
|
|
Don't know if it will work for you but have you looked at IPicture or IViewObject. You can set the aspect as DVASPECT_THUMBNAIL.
|
|
|
|
|
I am using an activeX control of a third party. The control name is "True Db Grid Pro 7.0".To populate this activeX i need another activeX named "ComponentOne XArrayDB Object (XADB7.OCX)". In VB this control is added through "REFRENCES" . How i add this refrences in VC++.
Addition in VB
--------------
"Select References… from the Project menu to display a list of available type library references. Select the check box labeled ComponentOne XArrayDB Object (XADB7.OCX), then press the OK button."
i tried to insert this activeX in VC++ but an error is prompted.
what i want to know
....................
what is equivalent of Vb REFRENCES in VC++
Have a nice wishes for helper.
|
|
|
|
|
hello everybody,
I have a c++ program in which i generate data that i
have to put in a excel file. But i don't know how
to write data in a excel cell.
Can you help me?
S.
|
|
|
|
|
Hi,
Have a look at http://www.codeguru.com/mfc_database/excel_sheets_using_odbc.shtml
it is a good starting point...
with greetings
Özgür
|
|
|
|
|
just write 0x00 to the file as you normally write a char to the file.
/Fredrik Sigbjörn
|
|
|
|
|
I use a CSocket derived class with a derived CWinThread class and use CArchive with it. For some yet unknown reason Send() locks after a while of running (hours). The opened socket has communication initiated from both client and server at times, if that helps. (Server sends tiny data once per second, client sends kB data occasionally, like every 10 seconds or so, plus both sides sends an ACK byte for every command)
Anyway, since I cannot find the reason of the locking, I want to get around the locked state. I want to make something from the outside and would like to have an OnIdle timer reset at intervals in the CWinThread. A parent thread will check this timer and if it isn't reset in reasonable time (seconds) the parent thread will call CancelBlockingCall() on the locked socket.
Now, will this work? Isn't it illegal to call the CSocket object function from another thread?
|
|
|
|
|
Hi,
I have a CFrameWnd dervied class ans i would like to remove the Min and Max buttons in the top right of the window. How would I acomplish this?
Cheers
Will
|
|
|
|
|
This code snip from MSDN about CWnd::PreCreateWindow explains this quite well.
// alter the styles of the main frame window
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
// Create a window without min/max buttons or sizable border
cs.style = WS_OVERLAPPED | WS_SYSMENU | WS_BORDER;
// Size the window to 1/3 screen size and center it
cs.cy = ::GetSystemMetrics(SM_CYSCREEN) / 3;
cs.cx = ::GetSystemMetrics(SM_CXSCREEN) / 3;
cs.y = ((cs.cy * 3) - cs.cy) / 2;
cs.x = ((cs.cx * 3) - cs.cx) / 2;
return CFrameWnd::PreCreateWindow(cs);
}
If you want to keep the old styles try this
cs.style &= ~WS_MAXIMIZEBOX;
cs.style &= ~WS_MINIMIZEBOX;
greets,
Fredrik Sigbjörn
|
|
|
|
|
Hello,
I want to write / find a program which dials to a given number wait till the anwering machine to answer, wait to the "beep" (online voice recognition) and play a recorded msg.
I'm searching for a week now for an already existing prog but all my searchings failed.
pls help me soon.
10x, tal.
|
|
|
|
|
I don't think any such program exists. CLosest to this is a program that comes with the MediaPhonics Phoneraider telephony card. Don't know the name on the product right now, but it's pretty versatile, however I don't think it can do what you want. And I think it only works with the PhoneRaider card.
http://www.mediaphonics.com
The other way is to program itself, then you need to use TAPI, and from my experience with them I can say that they are not the esiest APIs to use. Another way, that I used at my old company, is to let someone else wrap them for you. I bought the ExceleTel TeleTools classes, they are excellent to code all kinds of diffrent telephone solutions.
http://www.exceletel.com/
One more thing to note. Modem sucks when using them as phones, the quality are realy lousy. The MediaPhonics card is a better solution, the USB version is kewl, costs about $400 though
greets,
Fredrik Sigbjörn
|
|
|
|
|
<<first of="" all="" 10x="" for="" the="" fast="" response.
what="" is="" tapi="" ?="" (what="" t'="" stends="" ?),="" and="" whats="" difference="" from=""
regulay="" apis?
with="" which="" porogramming="" language="" it="" work="" on="" platform="" ?
where="" do="" i="" find="" help="" tutorial="" about="" ?
10x="" all,="" tal.="">>
TAPI is telephony API, and they are microsofts APIs for communicating with modems and telephone cards. They work only for Windows. You can probably use these in all languages on Windows.
Check MSDN for omre information on TAPI.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tapi/tapiovr1_4zxw.asp
greets,
Fredrik Sigbjörn
|
|
|
|
|
How can I get my machine's physical Address using Visual C++?
Just like Using "IpConfig /all" in command mode.
Give me some advice.Thanks a lot.
|
|
|
|