|
I inserted the “Microsoft Office Chart 10.0” control into the “ActiveX Control Test Container” then used "Spy++" to scope out the IDs -- no zeros to be seen! Your advice relies on implementation details of the controls in question.
Steve
|
|
|
|
|
Stephen Hewitt wrote: I inserted the “Microsoft Office Chart 10.0” control into the “ActiveX Control Test Container” then used "Spy++" to scope out the IDs
Ya u r right... Its an ATL active-x isnt it. when I chacked other ATL activex's, it also have have ID. But many other non ATL active x, the ID 0, like Calender,Micorsoft Form 2 controls( For those having windows ).
I have tried specifying the control id while creating the control. In such cases also Id is coming as 0. May be as you said its the implementation difference of control. But offcourse I think this is not under our control.
Do you think its the implementation differece of ATL Active X and MFC Active x?
|
|
|
|
|
Naveen.R wrote: Do you think its the implementation differece of ATL Active X and MFC Active x?
Both ATL's and MFC's hosting and control implentation details differ.
But this line of reasoning is missing the point: If you’re manipulating an ActiveX control you should manipulate it via the OLE control interfaces if possible and be weary of directly manipulating it’s window; windowless controls need not even have windows! One of the main goals of ActiveX control is to isolate clients of the implementation details of the control. ATL allows you to treat the control as a window but the window you manipulate is part of the hosting code and not part of the control: it handles messages and translates them into interface calls on the control. See the OnSize function in the "ATLHOST.H" file for an example.
Steve
|
|
|
|
|
Sorry I dont know much about ATL. May be we can focus on MFC..
What my doubt is that, when ever I create a MFC activex and add it to some applications, the control id is 0. Why this comes so? MFC ignores those ID's? ( Not only MFC activex but the activex like microsoft form 2 control also have same behavior )
|
|
|
|
|
The axtiveX I used was "Microsoft Forms 2.0 OptionButton", and I created it in the MFC application....
But in the Resource.h file the activeX control has the id which is not 0.
|
|
|
|
|
Can you tell me y u need the id of the control?
As i told earlier, that "Microsoft Forms 2.0 OptionButton" active x will be created with out an id. But MFC internally keeps the id of the control. check the COleControlSite::FindItem function() for more details.
|
|
|
|
|
hi,
i have created a new desktop and i successfully switched in to that destop. But any of windows shortcuts not working on my new desktop.ie, if i press Ctrl+Alt+Del the taskmanager executes on default desktop.
how can i solve this problem ? some one please help me.
Thanks & Regards
|
|
|
|
|
Great to hear that you've created your own desktop. Now you need to create your own Operating System.
All the best.
Sreedhar DV
[Real success is having courage to meet failure without being defeated.]
|
|
|
|
|
Hi, I have Two bmp file . Now I want to write A custom Programme so that
I can overlay One bitmap over other and save it to the file.
I try using VIDEOINFOHEADER . but cannot actually proceed how to
overlay one bitmap over other .
Trioum
|
|
|
|
|
Do you want to write a bmp on the other bmp file?
|
|
|
|
|
yes I want to overlay one bmp over other .
Trioum
|
|
|
|
|
Check this code
CImage m_File1,m_File2,mm;
CDC dc;
CBitmap bmp;
m_File1.Load(_T("c:\\1.bmp"));
m_File2.Load(_T("c:\\2.bmp"));
dc.CreateCompatibleDC(GetDC());
dc.FillSolidRect(CRect(0,0,800,600),RGB(53,97,200));
bmp.CreateCompatibleBitmap(GetDC(),800,600);
dc.SelectObject(bmp);
m_File1.BitBlt(dc.m_hDC,0,0,800,600,0,0,SRCCOPY);
m_File2.BitBlt(dc.m_hDC,150,150,800,600,0,0,SRCCOPY);
mm.Attach((HBITMAP)bmp.m_hObject);
mm.Save(_T("E:\\123.bmp"));
m_File2.Detach();
m_File1.Detach();
mm.Detach();
bmp.DeleteObject();
dc.DeleteDC();
|
|
|
|
|
Hamid. wrote: m_File2.Detach();
m_File1.Detach();
mm.Detach();
Nice memory leaks there
Those should be Destroy, not Detach.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
Hi Mark
you changed image on your profile;P.
|
|
|
|
|
Heh - no more filet-o-fish!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
hi all
i m working on a project where i need to lock file so that it can not be accessed again till certain conditions are met. the "LockFile ()" comd of VC++ deals with locking only a few selected bytes, is there any other such comd or method to achive my requirement????
please guide
thanks
|
|
|
|
|
if you run this code what happens?
HANDLE handle;
DWORD m_Pos,m_NumberofFile=0;
handle=CreateFile(_T("e:\\1.bmp"),
GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
dwPos = SetFilePointer(handle, 0, NULL, FILE_END);
LockFile(handle, m_Pos, 0, m_NumberofFile, 0);
|
|
|
|
|
How to get the file properities programatically.For ex get the last visited time of a file.
|
|
|
|
|
VC++ provides a series of file functions, this is one of them, search for "file functions" in MSDN and choose function to meet your requirement...
all the best
|
|
|
|
|
You can use of FindFirstFile or GetFileAttributes .
|
|
|
|
|
Hello all,
I am desparete and need help! I have been trying to figure this out for over a week now and cannot spend anymore time on this. Basically I am doing something that I have done a million times, but for sone reason it is not working in this instance. But even more bizarre, its not just working from one location...
Basically I am trying to do a HTTP_VERB_POST to log in to a popular web site. I have done this type of code over and over and its very straight forward. I wrote code to perform this task on my laptop while at work. After a while, I finally got it to work perfectly. It seems goes to the web site to the login page, extracts the values needed for the post and then I do an OpenRequest and then a SendRequest. Next, I read in the data from the CHttpFile. This completely worked. It downloaded the page saying that I have logged in. All was well, until I got home. Running the same program from teh same computer, but now on a different network (my home network, different IP address), it fails. But it fails in a way I have never seen before. The page returned from the HttpFile is complete garbage - unrecognizable characters (nothing I could display on here). I have never seen anything like this. And to add to my confusion, if I open up Internet Explorer and manually go to the website and log in, it works just fine. So this is not a case of the IP got banned or something like that. But computers use a router and both are behind a firewall. But I tested it with the firewall disabled, and no changes. But like I said, if I do it manually using IE, it works just fine. One other thing, in this SAME program, I log into a different web site (using the same code) and it works just fine...
Below is basically the code I used. The original code had the following in different functions, but I merged it together to make it an easier read. But I believe i got it all... Anyone have any clue at all on what could be going on. I'm deparate!!!!
Thanks,
Chris
Code:
------
CInternetSession *session;<br />
CHttpConnection* pConnection;<br />
<br />
session = new CInternetSession(NULL,1,INTERNET_OPEN_TYPE_PRECONFIG,NULL,NULL,INTERNET_FLAG_DONT_CACHE);<br />
<br />
strFormData = "SESSIONID=24325235&......";<br />
CString strHeaders = CString("Accept: image/gif, image/x-xbitmap, .....\r\n");<br />
<br />
DWORD dwServiceType;<br />
USHORT nPort;<br />
CString currentURL = CString(http:www.???);
AfxParseURL( currentURL, dwServiceType, sServerName, sObjectName, nPort );<br />
<br />
CString fileText;<br />
<br />
CHttpFile* pFile = NULL;<br />
<br />
try {<br />
pConnection = session->GetHttpConnection(_T(sServerName),nPort,"","");<br />
<br />
pFile = pConnection->OpenRequest(CHttpConnection::HTTP_VERB_POST, _T(sObjectName), NULL,1,NULL,NULL, INTERNET_FLAG_EXISTING_CONNECT|INTERNET_FLAG_DONT_CACHE );<br />
<br />
BOOL result = pFile->SendRequest(strHeaders, (LPVOID)(LPCTSTR) strFormData, strFormData.GetLength());<br />
<br />
if (pFile) {<br />
int len = pFile->GetLength();<br />
char buf[2000];<br />
<br />
int numread =0;<br />
CString cc;<br />
<br />
while ((numread = pFile->Read(buf,sizeof(buf)-1)) > 0) {<br />
buf[numread] = '\0';<br />
fileText += CString(buf);<br />
}<br />
}<br />
}<br />
<br />
catch (CInternetException* m_pException)<br />
{<br />
pFile = NULL;<br />
char test[1024];<br />
m_pException->GetErrorMessage(test,1024);<br />
m_pException->Delete();<br />
}<br />
<br />
CString webPage = fileText;
Chris
|
|
|
|
|
In accordance with W3C HTTP/1.1 standards, HTTP does not always necessarily respond in plain text. You are probably recieving a gzip compressed stream from the webserver.
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html[^]
Try removing "Accept-Encoding: compress, gzip" from the headers you are sending. If the webserver is compliant it should assume you do not accept compressed streams. On the other hand if the webserver ignores you and continues to send gzip compressed streams then you can possibly link with the zlib library to decompress the stream manually.
There may be a more simple method of decoding the stream but unfortunately this is not my area of expertise. Perhaps someome with greater knowledge with the CInternetSession and derivitive classes will respond.
Hope this helps,
-Randor (David Delaune)
|
|
|
|
|
That worked! I simply removed the "Accept-Encoding: compress, gzip" and it now reads in as normal HTML. I can't express how thankful I am! I'd gone over every aspect of it, but never considered it was compressed. Thanks so much!
Chris
|
|
|
|
|
I would like to take the first character from some text in an Edit box and add it as a new line in a Listbox.
Say I have Edit1 with the text C:\whatever
I want to add the first character C to the ListBox.
I'm at a loss as how to do this. Any help would be appreciated.
Using Borland c++ builder 6
|
|
|
|
|