|
There are no unsigned char or signed char overloads, as far as I know. You might have consulted faulty documentation.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
You use the STL istream class, which is defined as a stream of char and so it allows only char (not unsigned) parameter in methods.
The three mentioned istream functions are from Microsoft istream class in iostream.h . This library is obsolete in favor of STL.
Use the char buf[1024] .
Robert-Antonio
"Love without sex is like a fish without antlers"
|
|
|
|
|
Yes. I'm using STL istream class
I had no problem if I change from
#include <iostream>
using namespace std;
to
#include <iostream.h>
with VC 6.0
but I'm using .Net and .net doesn't let me use iostream.h but only STL
I will try to use only with char instead of unsigned char
Thank you
|
|
|
|
|
hi every body
i have inserted microsoft web browser ActiveX in my dialog and i want to use it's features!
there is no GetSource() in this activeX's functions So how can i Get the Source of HTML that i am navigating?
thanx a lot
-=Ehsan-de-Burge=-
|
|
|
|
|
Yes, it is possible. Here is how:
1. Use the IWebBrowser2::Document property to obtain an IDispatch interface to the DOM document.
2. Query the obtained IDispatch for IHTMLDocument3.
3. Use the IHTMLDocument3::createTextNode() method to convert the root node to text.
If you don't like that approach you can simply enable the menu bar using the IWebBrowser2::MenuBar() method. View source is there.
Ivor S. Sargoytchev
Dundas Software
|
|
|
|
|
Hi,
I'm using VisualC++ 6.0 on Windows2000.
I'm doing an application dealing with images ( with GDI ).
I'm investigating using GDI+.
Do you know if it is possible to create new Image Encoders/Decoders for other formats ( not supplied in GDI+) ? Basically, I need to handle RGB files ( SGI ) and my own format.
Thanks.
Stephane
www.exotk.org
|
|
|
|
|
I am on Unix and wanted to see an int on the screen so I did
int i = 9;
cout << '(' << i <<')';
But I dont see the value of i , just (). What do I need to do to i to make cout show it? I thought cout knew how to interpret the arg...
thanks,
ns
|
|
|
|
|
Try
int i = 9;
cout << '(';
cout << i;
cout << ')';
Another solution would be:
int i = 9;
printf("(%d)", i);
Hope this helps
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
ns asked a good question... isn't there any way to write this in a same cout line? that seem to be strange if we could.
Of course, i think cout << '(' << ((int) i) << ')'; would be better, but i didn't test it yet.
TOXCCT alias Nicolas C.
|
|
|
|
|
There's nothing wrong with your code, and it works just fine on my system. Are you sure you used exactly the same code as in your message in your program?
|
|
|
|
|
Oh. I found what I was doing wrong. I wasnt doing exactly what I posted. WHat I did is essentially tried to display char s
where I had set s = 0;
That was dumb but I didnt realise that it woas not going to show me a '0'.....
So I appreciate you taking the trouble to test it out...
thanks,
ns
|
|
|
|
|
Can I have any examples ??
Also, I want to ask how can I open two dialog box at the same time when running an application??
thx very much!!
|
|
|
|
|
|
I want to ask regarding the masking in Visual C++ . In my project i need to control 9 devices at the same time by using one parallel port interfacing,which is 3 fan, 3lamp, and 3 switch. So, how should i do,should i use the masking way and what is its source code.
|
|
|
|
|
Tan Sen Nee wrote:
...and what is its source code.
Its source code is whatever you write.
I'll assume you have a way of setting the parallel port to a word (16 bits) of your choice.
struct
{
WORD wLamp1 : 1;
WORD wLamp2 : 1;
WORD wLamp3 : 1;
WORD wGap : 4;
WORD wFan1 : 1;
etc...
} MyHardware;
MyHardware.wLamp2 = 1;
SetParallelPortFunctionOfSomeKind ((WORD *)&MyHardware);
MyHardware.wLamp2 = 0;
SetParallelPortFunctionOfSomeKind ((WORD *)&MyHardware);
Search your C(++) manual for "bit fields".
Iain.
|
|
|
|
|
hello,
I want to do pci detection in an MFC application. I wrote inline assembly codes to do it.
...
int a=0;
int c=0;
__asm
{
mov ax, 0xB101;
int 0x1A;
mov a,eax;
mov c, ecx;
}
...
The program was compiled. while running, when this function is called, it gives an error message as "The instruction at '0x....' referenced memory at '0xffffffff'. The memory could not be 'read'." and closes.
I could not find any documentation for pci bios functions on vc++. I need to do it in vc++; not in dos, or dos under windows.
It's not only the detection, but also I want to read from the pci config. space later on.
i would be very happy to get some help.
thanks...
|
|
|
|
|
caykahve wrote:
I want to do pci detection in an MFC application. I wrote inline assembly codes to do it.
In short, you can't.
MFC apps run in user mode. This is a lower privilege mode, and the OS stops you from accessing
hardware, other programs memory, etc.
You will need to write a device driver to do your hardware level work, and communicate with
it from your MFC app.
Neither of these steps are going to fit in a quick answer...
Iain.
|
|
|
|
|
How can i redarw controls(with changed co ordinates) in a MFC Application, once i have detected that resolution has changed??
|
|
|
|
|
Call the RedrawWindow function on the top level window with atleast the parameters RDW_INVALIDATE and RDW_ALLCHILDREN. It will step through all child windows itself and make sure every child window gets redrawn. Then again, if the resolution has changed don't all windows get a WM_PAINT message automatically?
|
|
|
|
|
thanx Luuk,
But it doesn't seem to work. Can u elaborate on it by an example.
|
|
|
|
|
Sure, it's quite simple:
LRESULT CMyFrameWnd::OnDisplayChange(WPARAM wParam, LPARAM lParam)
{
RedrawWindow(NULL, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_ALLCHILDREN | RDW_UPDATENOW);
return CFrameWnd::OnDisplayChange(wParam, lParam);
}
This should do the trick, if it doesn't then I suppose something else is going on.
|
|
|
|
|
Hi!
I have a problem with saving packets to a file. A packet loss occur at time XXYY. Then I will name open a file name it to XXYY, store some packets, and then close the file. Next time a packet is losses I will open a new file with the name as time HHMM. But it will not work. It cannot open the file.
Does anyone know how to do it???
Im store the time in a char buffer, and then I copy it into char Filename[20].
My code:
void WriteToFile()
{
strcpy(Filename, time[line])
ofstream outFile;
outFile.open(Filename, ios::out);
if(!outFile){cout << "cant open file"<
|
|
|
|
|
Add some breakpoints. Determine why the program cannot create the file.
Kuphryn
|
|
|
|
|
Ouuuuch! Trying to check statically declared ofstream for errors by if (!outfile) ?????
Use if (outfile.fail()) { ... } )
Robert-Antonio
"I launched Norton Commander and saw, drive C: on the left,
drive C: on the right...Damn, why I need two drives C:??? So I formatted one..."
|
|
|
|
|
Hi
Is it possible to add toolbar and statusbar to an dialogbased application?
WBR
Edi
|
|
|
|