|
i guess &buf return the address of buf and *buf is a pointer of buf. what is the importanc of using both of them??
what is the advantages of VC++ compared to VBasic??
i used fread to read a text file. then i want to insert the character of ' '(space) in betwen two words. does it effect the adress of the word in the file??
HelpMe
|
|
|
|
|
beardy janggut wrote: what is difference of &buf and *buf??
depends if you're talking in a declaration, or when using the variable.
MyType t;
MyType* pt;
MyType& rt;
pt = &t;
*pt = ;
rt = t;
rt = ;
beardy janggut wrote: what is the advantages of VC++ compared to VBasic??
Visual Basic is no way comparable with C++. C++ (thus Visual C++) produces natice code. native code is a binary code which is undertood directly by the microprocessor.
any Visual Basic before VB.NET were interpreted languages.
moreover, when C++ can do anything on a computer, Basic languages are pretty limited.
one last thing about VB vs C++. Basic languages are too much permissive and can let the developer take bad habits at programming. in C++, the compiler and the linker are quite strict in this way.
|
|
|
|
|
& is used to get the address of a variable: int Test = 7; , now, &Test will be the adress of the Test variable.
* is used to get the content pointed by a pointer. So, *(&Test) will give you 7 (wich is the content of the address).
beardy janggut wrote: what is the advantages of VC++ compared to VBasic??
Lots of things have been written about this subject, it is not like saying C++ or VB is better. It depends of your expectations. (Althought, lot of people here will say you that VB is crap ).
beardy janggut wrote: i used fread to read a text file. then i want to insert the character of ' '(space) in betwen two words. does it effect the adress of the word in the file??
You can't insert text like that in a file. You need to create a new file, write the data that is before what you want to insert, then write what you want to insert and finally write the rest of the data.
|
|
|
|
|
I'm trying using the IShellBrowser::BrowseObject function. After a hard working, finally it works. But now I found that it doesn't work on Windows 98 although it returns NOERROR.
Any one can help me?!!
M.N
|
|
|
|
|
Hello,
I have MS Word as the top window and a document is opened (let’s say Test.doc). I am wondering if there is a way to find out the path in which the Test.doc file is located (on a local folder or on a network share). Does anyone know a good article?
Thank you.
|
|
|
|
|
See if MSDN article Q183599 is of any help. It's not a direct answer to your question, but it may point you in the right direction, which is often a better choice anyhow.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Dear David,
Thank you very much. It seems that the article is a good approach of what I am looking for.
Best Regards,
|
|
|
|
|
You might be able to get away with something like:
_Application WordApp;
_Document Doc;
LPDISPATCH pDisp;
LPUNKNOWN pUnk;
CLSID clsid;
::CLSIDFromProgID(L"Word.Application", &clsid);
if (::GetActiveObject(clsid, NULL, &pUnk) == S_OK)
{
VERIFY(pUnk->QueryInterface(IID_IDispatch, (void**) &pDisp) == S_OK);
WordApp.AttachDispatch(pDisp);
pUnk->Release();
Doc = WordApp.GetActiveDocument();
CString str = Doc.GetFullName();
}
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I am writing a program that uses data structures such s std::vector and std::map and when I write a class that uses the structures and put the class in a dll, the compiler warns me against this saying the template classes cannot be exported.
Warning I recieved:
warning C4251: 'a' : class 'vector<int>' needs to have dll-interface to be used by clients of class 'MyClass'
a is a std::vector in my class MyClass
I get similar messages with std::map and the other data structures of the STL
Is there anyway around this problem because I do not want to write my own data structures but instead I want to use the STL.<code></code>
pplshero54 gives his most thanks
|
|
|
|
|
I am using Visual C++.NET
pplshero54 gives his most thanks
|
|
|
|
|
did you correctly said that std::vector<> had to be exported from the DLL with a mechanism such as __declspec( dllexport )
|
|
|
|
|
yes, I did all the correct __declspec stuff
pplshero54 gives his most thanks
|
|
|
|
|
How to acquired a pointer to Internet Explorer's IWebBrowser2 interface from IOleClientSite and IOleContainer?
Thanks
|
|
|
|
|
what do you need? IWebBrowser2 or IOleClientSite
|
|
|
|
|
Need to run this:
IOleCommandTarget* pCmdTarg;
CComPtr pWB;
CoCreateInstance(CLSID_WebBrowser, NULL, CLSCTX_INPROC, IID_IWebBrowser2, (void**)&pWB);
pWB->QueryInterface(IID_IOleCommandTarget, (void**)&pCmdTarg);
VARIANT vTemplatePath;
V_VT(&vTemplatePath) = VT_BSTR;
CComVariant vPTPath = argv[1];
pCmdTarg->Exec(&CGID_MSHTML, IDM_PRINTPREVIEW, NULL, &vPTPath, NULL);
But the pointer don't work.
|
|
|
|
|
if you change to CComPtr pWB to IWebBrowser2 pWB what happen?
|
|
|
|
|
Sorry! The code was this way: CComPtr <iwebbrowser2> pWB;
|
|
|
|
|
But CComPtr pWB; it was error unknown size
I think you need to CComPtr<ioleclientsite> pWB;
MSDN:
template< class T >class CComPtr
|
|
|
|
|
Sorry but I don't understand.
|
|
|
|
|
do you test //CComPtr<ioleclientsite> pWB;
|
|
|
|
|
I'm sorry to post this question here, but I'm a noob in C++. I'm a web programer(PHP, javascript, action script II), and I need very much of this.
I think the problem is the pointer. Why? I don't know, I just guess.
Thanks for your help!
|
|
|
|
|
I wanna capture the windowsNT logoff event.
WM_QUERYENDSESSION 'd help? and BTW can i trap this in
PreTranslateMessage() ??
I dont really like to keep logging off and On just to test this. your comments would be valuable
VuNic
|
|
|
|
|
You need to be looking out for WM_ENDSESSION , paying attention to the parameters of the message to tell if the user is logging off or not, or if a shutdown is being done.
Note that a well-known author wrote a few articles regarding problems with reliable detection of system shutdown and used something called the "Notepad test" to do it. Googling for that phrase may help.
You can also create a handler for the CTRL_LOGOFF_EVENT event (which may only be sent to console applications), which might work, too. A true Service will get shutdown notifications as well.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
thanks for the info james.
VuNic
|
|
|
|
|
Hi everyone,
I want to schedule a windows application(an IE window) to run at a fixed time and they system shud generate a message that the browser window is running and when if it shud close down due to any reason then also the system shud generate a message stating the browser has closed down.
Can any one please help me w/ a code or somthing ,i m having difficulty in using the schedule feature .
Thanking u
Regards,
Vikas
|
|
|
|