|
<< Probably because SETTEXT needs a pointer to the text, and that pointer must be valid in the destination app's address space. >>
But if SetWindowText() ends up using SendMessage, the text is in lParam. I'm confused ......... !!
Doug
|
|
|
|
|
you're welcome.
FYI: there are Win32 system calls that help you pass arbitrary amounts of data from one process to another; my LP#TrayIconBuster[^] article has an LP_Process class that shows how it's done in C#; similar techniques could be used in C/C++.
|
|
|
|
|
lParam holds the pointer to the text, and is assumed to be a valid pointer within the process' address space. It can not be an address in some other process.
|
|
|
|
|
>>Param holds the pointer to the text, and is assumed to be a valid pointer within the process' address space. It can not be an address in some other process.<<
Thanks for your patience, Luc !!
So that I can just FULLY understand this, let me describe it back to you with a few extra words (!!):-
The issuer of SendMessage() holds the variable containing the text (my app, in this case), and lParam is set up containing an address to this variable (within the senders address space ?). The receiver of SendMessage()(the 3rd party app, with which i'm endeavouring to interact) has access to lParam which contains the address of the original text, but as I'm alluding to above, is this address within the sender's address space ? I suspect that somewhere within the process, the text is COPIED to some global address space and it is THIS address that is contained within lParam. I can't see how else the process can work whilst protecting each app's memory space.
I await your words of wisdom, and to be "sorted out" !!
Again, thanks for your patience !
Doug
|
|
|
|
|
Hey, Iam looking for a function i could use that is just as easy to use as UrlDownloadToFile() on windows.
C or C++ doesnt matter.
Thanks.
|
|
|
|
|
|
Iam aware of curl, its not as easy to use as UrlDownloadToFile().
|
|
|
|
|
It may not be as easy to use but on the CURL website there's a simple HTTP[^] client in about 6 lines. Open a file to write to and use CURLOPT_WRITEDATA and snip snip, bob's your Aunty:
#include <stdio.h>
#include <curl/curl.h>
int main(void)
{
CURL *curl = curl_easy_init();
FILE *output_to = fopen( "output.txt", "w" );
if( curl && output_to )
{
curl_easy_setopt(curl, CURLOPT_URL, "curl.haxx.se" );
curl_easy_setopt(curl, CURLOPT_WRITEDATA, output_to );
curl_easy_perform(curl);
}
if( curl ) curl_easy_cleanup(curl);
if( output_to ) fclose( output_to );
}
Bundle that lot up in a function and you're done...
Cheers,
Ash
PS: There's no error reporting if the transfer goes pear shaped
PPS: I haven't programmed in C in years and not having cURL handy on my home computer I haven't checked the code compiles and runs but it's not far off
|
|
|
|
|
Search for a C++ library offering a HTTP client[^], see if it helps.
|
|
|
|
|
Hi all,
I'm using C++ with Win32 API, no MFC. I have a game with a normal game loop in the WinMain function. Within the loop I call all the processing and drawing and such. But for some reason, when I grab the edge of the application window with my mouse and resize it, the game loop just pauses. I still seem to be receiving WM_SIZING and WM_PAINT messages, which doesn't make sense because my PeekMessage is in the game loop and is not being called. I don't understand what's going on. Anyone have any ideas?
Thanks!!
KR
|
|
|
|
|
Can you post the snippet of the loop? I have the suspect you are using the Win32 message dispatching improperly
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
I might be wrong but as far as i know when you grab the window or size it, an "internal message loop" starts (probably it's somewhere inside one of the system DLLs, just a guess too) that handles the move/size operation, filters out some messages and lets others reach your window(s).
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
|
|
|
|
|
Is their any application that can retrieve class names for running Windows.
|
|
|
|
|
|
|
Hi,
While performing the print operation my application is crashing(only some times).
In logs i have found the following error:
Violation address: 0x7c93426d
Exception code: 3221225477
Description: EXCEPTION_ACCESS_VIOLATION: The thread tried to read from or write to a virtual address for which it does not have the appropriate access.
Access violation error at READING from 0x0.
Can somebody suggest me what may be the possible cause of error.
|
|
|
|
|
Why don't you use the debugger to find the offending line?
Have you more detailed info coming from the log file?
With the info you provided it is really hard guessing the reason of the error.
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]
|
|
|
|
|
Actually in my system it is not crashing.
The logs i got from the client machine.
I checked on the net and got the clue that it may the problem with installed drivers.
|
|
|
|
|
Actually at one place i am using the follwing code and dcRef is NULL in my case so it is going to the else part.
mDC = new CMetaFileDC();
if (mDC != 0)
{
HDC myhdl;
if (dcRef != 0)
{
myhdl = dcRef->m_hAttribDC;
}
else
{
myhdl = getDC();
dcRef = CDC::FromHandle(myhdl);
}
mDC->CreateEnhanced(dcRef, 0, bounds, description);
mDC->SetAttribDC(myhdl);
mDC->SetMapMode(MM_HIMETRIC);
}<pre>
Is there any problem in passing a pointer acquired from CDC::FromHandle to CreateEnhanced.
At some other place i am using
<pre>mMetaFileHandle = mDC->CloseEnhanced();
delete mDC;
mDC = 0;
do something .....
if (mMetaFileHandle != 0)
{
::DeleteEnhMetaFile(mMetaFileHandle);
mMetaFileHandle = 0;
}
HDC myhdl = getDC();
CDC dc;
dc.Attach(myhdl);
dc.DeleteDC();
In the above code getDC is returning a handle to the device context.
|
|
|
|
|
Hi every one.
I'm tring to save IHTMLElement which has IMG tag to hard drive. I'm not tring to save the entire web page as image. NO. I'm tring to save single image (IHTMLElement of Tag IMG) to hard drive.
I tried IHTMLElementRender::DrawToDC(), but it works only if the IHTMLElement size is less than the physical size of my computer screen. If the IHTMLElement (the single image or picture) size is larger than my computer's screen, the function ( DrawToDC() ) draws partial image.
Any help????????
Thanks
|
|
|
|
|
|
Thanks for replaying. But the thing is I do not want to download the image again. IWebBrowser control downloaded the image already. I want to save form IWebBrowser not download it from internet again.
|
|
|
|
|
Hi all ,
Outlookbar-style menu interface[^]
i m using this code ,i want to display Infotip or Tooltip for Items and Subitems,because some of my Items and subitems are long so they are not properly disaplay here.
so i want to use Infotip or Tooltip for Items and Subitems ,to display full text of items and subitems on mouse move.
if number of subitems are large so some items might disappear ,so i want to insert vertical scrollbar it this situation.
please help me for this.
thanks in advance.
modified on Saturday, July 10, 2010 5:19 AM
|
|
|
|
|
Hi sir,
I am not able to open the dialog.
Its showing the error as.
"C:\DataBase\Sample.MDB" is not a valid path.Make sure that the path name is spelled correctly and that you are connected to the server on which the field resides.
void CMainView::OnAdminlist()
{
AdminList.DoModal();
}
When i go into that function,i am getting error as
i.e \MFC\SRC\DLGCORE.cpp
TRY
{
AfxHookWindowCreate(this);
Brekpoint error---------> if (CreateDlgIndirect(lpDialogTemplate,
CWnd::FromHandle(hWndParent), hInst))
{
if (m_nFlags & WF_CONTINUEMODAL)
{
DWORD dwFlags = MLF_SHOWONIDLE;
if (GetStyle() & DS_NOIDLEMSG)
dwFlags |= MLF_NOIDLEMSG;
VERIFY(RunModalLoop(dwFlags) == m_nModalResult);
}
if (m_hWnd != NULL)
SetWindowPos(NULL, 0, 0, 0, 0, SWP_HIDEWINDOW|
SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE|SWP_NOZORDER);
}
}
CATCH_ALL(e)
{
DELETE_EXCEPTION(e);
m_nModalResult = -1;
}
END_CATCH_ALL
Actually first the application was in MS-Access DatBase.I changed it to SQL.
Now i am not getting what is this error.
Note : nd one more thing is
If i am trying to open the application for the first time(If the DataBase which is created with MSAccess) name is changed
For ex: I rename the database from"DatBase" to "DataBase1"
I am getting the error message before opening the application.
>"C:\DataBase\Sample.MDB" is not a valid path.Make sure that the path name is spelled correctly and that you are connected to the server on which the field resides.
If i dnt change the DataBase name i am not getting this error message when i open the application
Where may be the problem
Any idea will be helpful
Thanks
Raj
modified on Saturday, July 10, 2010 12:43 AM
|
|
|
|
|
You seem to be getting confused between two different errors.
1. If your path to the database file is not correct you will get the errors above. The error message could not be more clear as to the cause of the problem, the solution is simply to ensure that the file exists and the path in your program is correct.
2. AdminList.DoModal(); is giving an error trying to create a modeless dialog. This does not make much sense since a call to DoModal(); should show a modal dialog. However the information you provided does not show how AdminList has been created.
It's time for a new signature.
|
|
|
|