|
|
apparently the problem is with the compiling computer. it works fine in other computers. i tried installing MS SDK, VC++ SP5, clearing up the registry... and nothing works.. haha.. will be installing a new copy of VC++ today.. thanks for all the help guys. BUnch of great ppl we have here!!!
|
|
|
|
|
Hello everyone.
I am a beginner of WTL and STL.
Could you tell me whether STL can be used in a WTL project?
and I need to read data from file line by line,
is there a way to do it like "CStdioFile" of MFC?
Thank you.
-Freehawk
|
|
|
|
|
Hello,
Usel low level or stdio.h in WTL/ATL for e.g
fopen(....);
fwrite(...);
fread(...);
regards
balkrishna talele
|
|
|
|
|
Thank you for the fast reply.
is there way to read file line by line?
-Freehawk
|
|
|
|
|
Hey come on...
if you use
char *readme;
while(!feof(fp))
{
fscanf(fp,"%s",readme);
}
u will get line by line..
cheers
Balkrishna Talele
|
|
|
|
|
Thank you very much.
I will try it.
-Freehawk.
|
|
|
|
|
No you will not. You will get "token by token". Try fgets instead.
--
So let's just walk from place to place, as long as we don't talk face to face.
|
|
|
|
|
|
There you go, always thinking differetly
I have lost more blood shaving than on the battlefield - Adolf Hitler
|
|
|
|
|
freehawk wrote:
Could you tell me whether STL can be used in a WTL project?
STL can be used with any C++ project.
freehawk wrote:
and I need to read data from file line by line,
#include < iostream >
#include < fstream >
#include < string >
int main()
{
std::ifstream f( "c:\\test.txt" );
std::string fline;
while(std::getline( f, fline) )
std::cout << fline << std::endl;
return 0;
}
---
“Our solar system is Jupiter and a bunch of junk” - Charley Lineweaver 2002
|
|
|
|
|
Thank you and everyone very much.
It is useful to me and I can know it clearly.
-Freehawk
|
|
|
|
|
Less typing:
#include < iostream >
#include < fstream >
#include < string >
using namespace std;
int main()
{
ifstream f( "c:\\test.txt" );
|
|
|
|
|
I have a com object in which there are different properties. When i get these values through it works well when property is returning long or some other integer but it crashes when property is returning bstr. Take a look at my code and guide me that what i did wrong.
VARIANT pvResult;
memset(&pvResult, 0, sizeof pvResult);
VariantInit(&pvResult);
DISPID dispID=this->pColl->getMemberID(index);
DISPPARAMS dispParamsNoArgs={NULL,NULL,0,0};
HRESULT hr=pDispatch->Invoke(dispID,IID_NULL,LOCALE_USER_DEFAULT,
DISPATCH_PROPERTYGET,&dispParamsNoArgs,
&pvResult,NULL,&nArgErr);
Thanx in advance
Inam
|
|
|
|
|
The EOF marker has arisen from its MS-DOS grave to cause troubles for me -- I have an ifstream (which I open with the ios::binary flag specified) that refuses to read past a 0x1A byte. What am I doing wrong? The only calls I make are:
ticks.open(fn, ios::in || ios::binary);
...
ticks.seekg(fpos<int>(0, iter->offs));
...
ticks.read((char *) &data, sizeof (data));
if (ticks.eof()) return;
Whenever the initial byte of the block to be read is 0x1A, the read fails and eof() returns true. The same code works elsewhere and it's causing me a bit of grief. Any help greatly appreciated.
READIN writin rhythmetic
|
|
|
|
|
ticks.open(fn, ios::in || ios::binary); should be
ticks.open(fn, ios::in | ios::binary); but I don't happen to know how this could result in the strange behavior you describe.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Bingo! thanks, that's it -- the "ios::in || ios::binary" will of course resolve to 1, instead of the bitmap that I want. Thanks again; sometimes I need someone else to look at my code and point out the obvious mistake.
READIN writin rhythmetic
|
|
|
|
|
Hello everybody,
Does anybody know, how I can convert an in-proc server project written in ATL 3.0 (VC++ 6.0) to local server (exe version) or vice versa?
I mean that what changes, I have to make to the project settings and maybe to the source code and/or other files in the project? I have seen a sample project "ADOSAMP" that has several project settings for building dll or exe versions.
Regards,
Roozbeh
|
|
|
|
|
It's probably easier to just create a new project and copy the code from the in-proc project to the other. Make sure you update the .rgs files to reflect the new server type.
--
So let's just walk from place to place, as long as we don't talk face to face.
|
|
|
|
|
There is another way - DllSurrogate - which allows to use the in-proc as out-proc server.
With best wishes,
Vita
|
|
|
|
|
Hi all,
Is there any way to get the handle to menu window in internet browser window?
I want to disable some menu items in File,Edit,View. I am using VC6.0 and Win2k.
Thanks in advance,
Abhishek
|
|
|
|
|
I'd like to have data file with many strings and load them at once using MapViewOfFile[Ex] and unload with UnmapViewOfFile. So I wouldn't have to allocate memory for each string on heap.
How can I use basic_string<> or CStringT attaching them to pointer to string within mapped space so they wouldn't copy that string to internal buffer?
--
Alvin777
|
|
|
|
|
|
Hi all,
Who and when IDocHostHandler::ShowUI() is invoked?.
I wish to know whether this function gets invoked before loading webpage?
Thanks in advance,
Abhishake
|
|
|
|
|
I am trying to read an html page and retrieve the value of three hidden input fields sure as:
<input name=port type=hidden value=1500>
VC++6.0/ATL/BHO -- Below is the code I am working with to read in the value (1500) but it is not working. I think i am missing something.
HRESULT hr;
TCHAR sPort[25];
IDispatch* pElemDisp = NULL;
IHTMLInputHiddenElement* pElem = NULL;
IHTMLElementCollection *pElemcoll;
// Get the WebBrowser's document object
CComPtr<IDispatch> pDisp;
HRESULT hr = m_spWebBrowser2->get_Document(&pDisp);
if (FAILED(hr)) return false;
CComQIPtr<IHTMLDocument2, &IID_IHTMLDocument2> spHTML;
spHTML = pDisp;
_variant_t tagName("input");
_variant_t tagNamePort("port");
BSTR* pValuePort = NULL;
spHTML->get_forms(&pElemcoll);
hr = pElemColl->tags( tagName, &pElemDisp );
if ( SUCCEEDED(hr) )
{
hr = pElemDisp->QueryInterface( IID_IHTMLInputHiddenElement, (void**)&pElem );
if ( SUCCEEDED(hr) )
{
hr = pElem->get_value(pValuePort);
if ( SUCCEEDED(hr) )
{
//Set port
_stprintf(sPort, _T("%s"), (LPCTSTR)pValuePort);
m_sPort = (int)sPort;
}
pElem->Release();
}
pElemDisp->Release();
}
//at this point m_sPort is NULL not 1500
I think I may not be handling the Element Collection object correctly. Any pointers as to where i am going wrong?
Thank you for any help you can give..
|
|
|
|