|
i have added .h and .cpp ,i have added them from classwizard,by selecting respective tlb file..
|
|
|
|
|
RockyJames wrote: fatal error C1010: unexpected end of file while looking for precompiled header directive
doesn't that error usually mean you need to include stdafx.h??? Last modified: Wednesday, July 12, 2006 1:13:22 PM --
|
|
|
|
|
stdafx.h is included in the project..
|
|
|
|
|
If the compiler says "undeclared identifier" it means it can't find it. There are two possibilities:
1. A missing header file.
2. The identifies name is wrong or it's in a namespace and you haven't qualified the name with it or put in a using statement to import it.
Knock number two on the head by adding no_namespace after the #import . i.e.
#import "Voodoo.tlb" no_namespace
This tells the compiler not to use namespaces.
Steve
|
|
|
|
|
Is there any other way to use COM components in code without importing (#import) and server module (any compnent file like .tlb ). Can anybody suggest me a sample link for the same...?
-Malli...!
|
|
|
|
|
When the component is authored the interface is probably described in an IDL or ODL file. If so, when it is compiled with MIDL a type library and some C++ header files are produced. If these files are distributed you can use these for C++.
If the interfaces are IDispatch based you could use the library without any type information, but this hard to describe and not the best approach in C++ anyway.
Steve
|
|
|
|
|
1.
HMENU hMenu = unknow value
GetSubMenu(hMenu, 0) == 0x1234
have method know hMenu == ? or its string?
2.
in MFC project, i dynamic add a popup menu item, but not handle it in code, CCmdUI disenable it.
have method not modification MFC project and handle message to enable it?
Thanks.
|
|
|
|
|
None of this makes any sense. Please rephrase. What exactly are you trying to do?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
How are you importing your tlb file?
Remember that unless you specify it, you will need to specify the namepace scope. So:
#import "somelibrary.tlb" named_guids
..
..
HRESULT hr = CoCreateInstance(SOMELIBRARYLIB::CLS_ITest, NULL,
CLSCTX_ALL,
SOMELIBRARYLIB::IID_ITest, (void**)&pTest);
..
..
Notice the namepace scope.
I Dream of Absolute Zero
|
|
|
|
|
Hi all,
I want to write a plug-in for windows media player.
And I am almost a begiiner in this codes.
Please help me , Maybe an article.
Thank you .
Every new thing you learn,Gives you a new personality.
|
|
|
|
|
Hi all could any one tell me what is the the equivelent the following visual basic 6 code. txtURl holds a url of a perticuler website.Thanks
RichTextBox1.Text = Inet1.OpenURL(txtURL.Text, icString)
|
|
|
|
|
There is no direct equivalent. Try calling InternetOpenUrl() followed by InternetReadFile() .
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
thank u for u reply. could u tell me how to sue these 2 . where to specify the url ? i want the html to be placed inside editbox. could u just show me how.Thanks
|
|
|
|
|
method007 wrote: could u just show me how
Googling: MSDN InternetReadFile
produced hits where the second one listed is titled "Building an Internet Browser Using the Win32 Internet Functions". The following sample code is contained in that article which you could have easily found for yourself.
HINTERNET hNet = ::InternetOpen("MSDN SurfBear",
PRE_CONFIG_INTERNET_ACCESS,
NULL,
INTERNET_INVALID_PORT_NUMBER,
0) ;
HINTERNET hUrlFile = ::InternetOpenUrl(hNet,
"http://www.microsoft.com",
NULL,
0,
INTERNET_FLAG_RELOAD,
0) ;
char buffer[10*1024] ;
DWORD dwBytesRead = 0;
BOOL bRead = ::InternetReadFile(hUrlFile,
buffer,
sizeof(buffer),
&dwBytesRead);
::InternetCloseHandle(hUrlFile) ;
::InternetCloseHandle(hNet) ;
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
Thank u for u reply. so how to use the html code and display it in a textbox ?
I tried this to place the html in textbox and gives me 17 errors!!
void CFindUserDlg::OnButton4() <br />
{<br />
<br />
HINTERNET hNet = ::InternetOpen("MSDN SurfBear",PRE_CONFIG_INTERNET_ACCESS,NULL,INTERNET_INVALID_PORT_NUMBER,0) ;<br />
HINTERNET hUrlFile = ::InternetOpenUrl(hNet,"http://www.cnn.com",NULL,0,INTERNET_FLAG_RELOAD,0) ;<br />
<br />
char buffer[10*1024] ;<br />
DWORD dwBytesRead = 0;<br />
BOOL bRead = ::InternetReadFile(hUrlFile,buffer,sizeof(buffer),&dwBytesRead);<br />
<br />
SetDlgItemText(IDC_EDIT2,buffer);<br />
<br />
::InternetCloseHandle(hUrlFile) ;<br />
::InternetCloseHandle(hNet) ;<br />
<br />
<br />
}
-- modified at 13:00 Wednesday 12th July, 2006
|
|
|
|
|
from the sample the "char" array named "buffer" would contain the HTML. In C/C++ char arrays are "strings" so basicaly you can copy that buffer into the edit control.
I don't know why you are doing this in C++ from a VB background but things are very different in C/C++ from VB. There are so many different ways to get a char array into a windows edit control depending on "how" you are developing your solution. If using MFC you have classes that you are using that simplify these operations. If not you must send messages to windows controls to interact with them. This is a small part of the fundamental knowledge needed for windows development in C/C++. Asking questions in a forum about using API's when you don't have basic C/C++ experience will be a very slow and tiresome process.
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
well i have done this in visual basic 6 but i am working in a project that is only possible in visual c++ and this has to be done in visual C++ as well
Any ways still i did not get my asnwer.!! i want to place the html code of the url inside a variable and editbox but adding SetDlgItemText(IDC_EDIT2,buffer); to your code did not compile and gave me 16 erros!!
could u just help me fix that problem
errors:
--------------------Configuration: FindUser - Win32 Debug--------------------<br />
Compiling...<br />
FindUserDlg.cpp<br />
C:\visualC\FindUser\FindUserDlg.cpp(330) : error C2065: 'HINTERNET' : undeclared identifier<br />
C:\visualC\FindUser\FindUserDlg.cpp(330) : error C2146: syntax error : missing ';' before identifier 'hNet'<br />
C:\visualC\FindUser\FindUserDlg.cpp(330) : error C2065: 'hNet' : undeclared identifier<br />
C:\visualC\FindUser\FindUserDlg.cpp(330) : error C2039: 'InternetOpen' : is not a member of '`global namespace''<br />
C:\visualC\FindUser\FindUserDlg.cpp(330) : error C2065: 'InternetOpen' : undeclared identifier<br />
C:\visualC\FindUser\FindUserDlg.cpp(330) : error C2065: 'PRE_CONFIG_INTERNET_ACCESS' : undeclared identifier<br />
C:\visualC\FindUser\FindUserDlg.cpp(330) : error C2065: 'INTERNET_INVALID_PORT_NUMBER' : undeclared identifier<br />
C:\visualC\FindUser\FindUserDlg.cpp(331) : error C2146: syntax error : missing ';' before identifier 'hUrlFile'<br />
C:\visualC\FindUser\FindUserDlg.cpp(331) : error C2065: 'hUrlFile' : undeclared identifier<br />
C:\visualC\FindUser\FindUserDlg.cpp(331) : error C2039: 'InternetOpenUrl' : is not a member of '`global namespace''<br />
C:\visualC\FindUser\FindUserDlg.cpp(331) : error C2065: 'InternetOpenUrl' : undeclared identifier<br />
C:\visualC\FindUser\FindUserDlg.cpp(331) : error C2065: 'INTERNET_FLAG_RELOAD' : undeclared identifier<br />
C:\visualC\FindUser\FindUserDlg.cpp(335) : error C2039: 'InternetReadFile' : is not a member of '`global namespace''<br />
C:\visualC\FindUser\FindUserDlg.cpp(335) : error C2065: 'InternetReadFile' : undeclared identifier<br />
C:\visualC\FindUser\FindUserDlg.cpp(339) : error C2039: 'InternetCloseHandle' : is not a member of '`global namespace''<br />
C:\visualC\FindUser\FindUserDlg.cpp(339) : error C2065: 'InternetCloseHandle' : undeclared identifier<br />
Error executing cl.exe.<br />
<br />
FindUser.exe - 16 error(s), 0 warning(s)
code that give me 16 errors:
void CFindUserDlg::OnButton4() <br />
{<br />
<br />
HINTERNET hNet = ::InternetOpen("MSDN SurfBear",PRE_CONFIG_INTERNET_ACCESS,NULL,INTERNET_INVALID_PORT_NUMBER,0) ;<br />
HINTERNET hUrlFile = ::InternetOpenUrl(hNet,"http://www.cnn.com",NULL,0,INTERNET_FLAG_RELOAD,0) ;<br />
<br />
char buffer[10*1024] ;<br />
DWORD dwBytesRead = 0;<br />
BOOL bRead = ::InternetReadFile(hUrlFile,buffer,sizeof(buffer),&dwBytesRead);<br />
<br />
SetDlgItemText(IDC_EDIT2,buffer);<br />
<br />
::InternetCloseHandle(hUrlFile) ;<br />
::InternetCloseHandle(hNet) ;<br />
<br />
<br />
}
My whole intention is to extract data once i get the html of perticuler url .
I want to extract the bold parts of html as below.could u show me how to collect the bold part data from a webbrowser controle html . I want to collect those data and place them in a listview and use the color code to color the name in listview.
Note: i want to extract the name and color1 and color2 data from webbrowsser controle as shown in pic
[IMG]http://i5.photobucket.com/albums/y180/method007/extractData.jpg[/IMG]
webbrowser html code:
<html><br />
<br />
<head><br />
<meta http-equiv="refresh" content="60"><br />
</head><br />
<br />
<br />
<p><ul><table border=1 cellpadding=4<br />
<br />
<tr><th>Name</th> <th> color </th> <th> color2 </th> </tr><br />
<tr><td><font color="0800">tony</font></td> <td>32768</td> <td>0800</td><br />
<br />
<tr><td><font color="FF0FF">cindy</font></td> <td>16711935</td> <td>FF0FF</td><br />
<br />
<tr><td><font color="800FF">sarah</font></td> <td>16711808</td> <td>800FF</td> <br />
<br />
</table><br />
</body><br />
</html>
-- modified at 13:24 Wednesday 12th July, 2006
|
|
|
|
|
method007 wrote: is only possible in visual c++
Why? A .NET application would seem to be a much better choice.
method007 wrote: code did not compile and gave me 16 erros!!
this is exactly what I meant about not having C/C++ basic experience. It could take you months and hundreds of posts to finsish your job using a forum.
method007 wrote: error C2065: 'HINTERNET' : undeclared identifier
That means you have not included a required header file. That is basic C/C++ knowledge. A perfect example of what I am telling you. If you are going to develop using VC++ you better go back to the start and learn some basics, jumping into an actual project when you don't even know about including header files is completely insane.
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
i know man i need to learn the basic and i do not know how to defind a header for it !! (
|
|
|
|
|
Buy a book for beginner C++ . Don't do a project until you actually understand everything in the book. Once you understand everything in the beginner C++ book you will have scratched the surface.
Then repeat for Windows Development.
Then repeat for HTTP and HTML ( of course this book may not exist ).
Of course there is the famous book "Learn Visual C++ in 21 days". You could try that one... and if in 21 days you have actually learned Visual C++ "completely" you should donate half your salary for the next 5 years to the author.
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
man i have the book Learn Visual C++ in 21 days and i read first few chapters. so u think your solution will allow me get the dynamic html that i need for further process corectly? The reason i want to make sure is that the html that i am after is dynamic and i need to retrive it every one min so i do not want to get the old html for each request.
Furthermor, could u tell me what chapter of that books talkes about retriving html ?
|
|
|
|
|
I must apologize. My comments about that book are pure sarcasm. No one can learn Visual C++ in 21 days. I have no idea what is in the book because the title is so stupid I would never read it or recommend it.
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
led i want to thank u i fixed that code it works good! )
|
|
|
|
|
First, I thank those who provided their feedback from earlier post.
I need some tweaking once again
As stated earlier, I have a program that should accept only keyboard input of integers from 1 to 12.
Someone suggested I try the scanf() function. I did something with it as shown below. Currently, it allows all integers as valid input and no other characters (letters, punctuatation, symbols, ect . . .).
This is fine. But, how can I further restrict user input with the scanf() function to allow only integers 1 thru 12? Or should I use another method? This is my first time using scanf. I've already tried the while conditions
while (data >=0 || data <= 13), (data >=0 && data <= 13) with not much luck. At this point I'm not sure if I should change how I'm retrieving the data (thru cin or getline). This is a very pivotable part of the program and the whole program is dependent on this functionality. Help is appreciated.
char buff[1024];
unsigned int value;
int charsRead;
bool validEntry = false;
while (!validEntry)
{
cout << "Please enter the number of subunits: ";
cin.getline(buff, 1023, '\n');
if (sscanf(buff, "%u%n",&value,&charsRead)==1)
validEntry = true;
}
-- modified at 11:13 Wednesday 12th July, 2006
|
|
|
|