|
I have an MDI app that contains an open and modified document. The file specification of the document is in a UNC format (GetDocument()->GetPathName() returns \\Server\Share\MyDocument.txt). When I click on Save As, MFC calls GetSaveFileName() for me to display the CFileDialog so that I can enter a filename. When the dialog box is displayed I get four copies of the following message displayed in the debugger's output window: "First-chance exception in MyProgram.exe (RPCRT4.DLL): 0x000006BA: (no name)." If I look at the m_ofn.lpstrFile member variable that GetSaveFileName uses, the filespec is in UNC format. If I gludge things up, map a drive, and change m_ofn.lpstrFile to be a normal file spec (c:\temp\MyDocument.txt), I don't get these exceptions! In either case, the Save As appears to work just fine - the exceptions don't seem to bother things.
Does anyone with UNC experience know what is going on here? Is there something special I need to do when using UNC file specs - i.e. some flag I need to set?
Thanks,
Don Sanders
|
|
|
|
|
Does anyone with UNC experience know what is going on here?
I don't have much UNC experience, but think that you can safely ignore these messages. KB article Q105675 has more info on 'first-chance exceptions'.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
How can I make the computer beep w/ a few lines of code?
|
|
|
|
|
|
or
::MessageBeep(0);
To hell with those thin-skinned pillow-biters. - Me, 10/03/2001
|
|
|
|
|
Is easy:
With the Beep function....
Carlos Antollini.
Today is Friday?
No Bob!!!
|
|
|
|
|
I don't know if it calls messagebeep, but beep(50,50) works fine. You can put any numbers you want, they still sound the same ;0)
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Beep(500,500);
works best on my w2K system.
|
|
|
|
|
According to Big Bad Bill, Beep() does the right thing on NT (and perhaps 2000), but not on Win 9x/ME.
/ravi
"There is always one more bug..."
ravib@ravib.com
http://www.ravib.com
|
|
|
|
|
I frequently use Beep as a sophisticated debugging tool, and I've not noticed it doing any different under W2000. Not that I was looking.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Guys, I agree with Christian, The most important that the machine will do a simple Beep. It did Work?
Ready.....
Cheers!!!!
Carlos Antollini.
When Is Friday?
|
|
|
|
|
\a makes a beeb for those who have ME and cant use the beep function(like me )
cout<<"beep sound \a";
<marquee>Raffi
|
|
|
|
|
Unplug the keyboard and reboot
|
|
|
|
|
COULD SOMEONE HELP ME OUT AS TO HOW TO WRITE A WRAPPER IN Visual C++ 6 I have a dll (SbLm_LogClient.dll ) written in C which I need to use in my vb code. I guess the DLL functions uses _cdecl convention. I guess the way round it is to write a wrapper in C++ using the __stdcall convention. I know the dll exposes two interfaces.
Interface 1 - SbLm_Log accepts an Integer and a Char
Interface 2 - SbLm_CloseLogClient is a sub, it accepts no parameters
I have an include file from the from the author of the .a and .h file. The content of the .h file is below
#ifdef WINDOWS_NT
#ifndef SbLm_LogClient_h_included
#define SbLm_LogClient_h_included
#ifdef BUILDING_DLL
#define DLLIMPORT __declspec (dllexport)
#else /* Not BUILDING_DLL */
#define DLLIMPORT __declspec (dllimport)
#endif /* Not BUILDING_DLL */
DLLIMPORT int SbLm_Log(int, char *);
DLLIMPORT int SbLm_CloseLogClient();
#endif // SbLm_LogClient_h_included
#else
int SbLm_Log(int, char *);
int SbLm_CloseLogClient();
#endif
|
|
|
|
|
I am developing my own custom ActiveX Control for the first time and I am not sure how to design the GUI for this control using the resouce editor. Do I have to setup my control in code?
Please help.
|
|
|
|
|
I have a serial port class which continously polls the serial port and writes to the serial port as needed. I have a seperate thread for reading from the serial port. My problem is that I created the handle for the serial port in the main thread to be used when writing to the serial port, but I need to use that same handle in the other thread so that I can read from the serial port. I passed the handle to the worker thread, but I can't use it because it's not part of the thread's handle map. How can I get a handle to the serial port in the worker thread?
Mark Lenz
|
|
|
|
|
When I need to make that I use a global Variable with the handle that I need to use.
For example If I have a conecction with a database, I don't use diferent conections for each handle, I put the connection pointer into a global variable, that is acceded for each handle, and this work, i don't Know if you will have any problem with this practice.
I hope to help you...
Carlos Antollini.
Is today Friday?
No Bob!!!
|
|
|
|
|
take a look at DuplicateHandle,
and use 1 handle for writing and the other for reading..
hope this helped
B.Bruggeman
|
|
|
|
|
Does the structure, for example 8 bpp bitmap, goes thus:
Red;
data+=byte;
Green;
data+=byte;
Dark blue;
data+=byte;
// Miss of reserve
data+=byte;
If so, whence to take colours?
Willn't structure RGBQUAD help any more?
I.e. what analog will be to string:
Red = Quad->rgbRed?
There can be I are mistaken?
In what my error?
|
|
|
|
|
No, an 8 bit bitmap has the structure where each byte represents a lookup into the palette, so each colour is represented by one number between 0 and 255, and you need to look up the colour in the palette.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
I understand it. But, how to get it. For 24 and 32 bpp bitmap i use RGBQUAD,
scanline and other. What do i need for 8 bpp bitmap, how to get color for every pixel, if RGBQUAD doesn't work correctly for it.
What do i need to change in this code for 8 bpp?
for( int y = lpBitmap->biHeight; y>0; --y )
{
ScanLine = Bits + (WidthBytes * (y-1));
Data = ScanLine;
for( int x = 0; x<lpbitmap->biWidth - 1; ++x )
{
LPRGBQUAD Quad = (LPRGBQUAD) Data;
Blue = Quad->rgbBlue;
Green = Quad->rgbGreen;
Red = Quad->rgbRed;
BYTE color = (Red + Green
+ Blue)/3;
Data += BytesPerPixel;
}
|
|
|
|
|
I'm not sure how you're accessing your bitmap, but you needc to change the values in the palette. That is why changing a colour on an 8 bit bitmap changes it for the whole thing, because each pixel is not stored as a discrete value. So for this function, you need to lookpu the value in the palette, and get the red/green/blue from there. BTW if you're going for greyscale, you should do this:
grey = .299 * red + .587 * green + .114 * blue
This takes into account thte way the eye percieves each colour.
I'm about to take my kid to the show, but if you're still stuck LMK and I'll try to find some source when I get back.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Thanks for your help, i really need it!
|
|
|
|
|
I work with microscope and i have avi file from surface.
I need intensity of every pixel. I need it for mathematical manipulations with images (filters and other stuff). So, i open avi file and take a frame from avi like
LPBITMAPINFOHEADER lpBitmap = (LPBITMAPINFOHEADER)AVIStreamGetFrame(pVideoFrame, nFrame);
and save it as txt file, which works for 24 and 32 bpp.
But i need 8 bpp and 16 bpp bitmaps (little size)
//Code
int BytesPerPixel = (lpBitmap->biSizeImage)
/(lpBitmap->biHeight * lpBitmap->biWidth);
int WidthBytes = lpBitmap->biWidth * BytesPerPixel;
int size = sizeof(BITMAPINFOHEADER)
+ sizeof(RGBQUAD) * lpBitmap->biClrUsed;
BYTE *Bits = (LPBYTE)lpBitmap
+ size;
BYTE * ScanLine;
BYTE * Data;
unsigned long Red, Green, Blue;
CStdioFile skadr;
CString string;
skadr.Open(filename, CFile::modeCreate|CFile::modeWrite);
for( int y = lpBitmap->biHeight; y>0; --y )
{
ScanLine = Bits + (WidthBytes * (y-1));
Data = ScanLine;
for( int x = 0; x<lpbitmap->biWidth - 1; ++x )
{
LPRGBQUAD Quad = (LPRGBQUAD) Data;
Blue = Quad->rgbBlue;
Green = Quad->rgbGreen;
Red = Quad->rgbRed;
unsigned long color = (Red * 0.299)
+ (Green * 0.587)
+ (Blue * 0.114);
string.Format("\t %d", color);
skadr.WriteString(string);
Data += BytesPerPixel;
}
string.Format("\n" );
skadr.WriteString(string);
}
|
|
|
|
|
The thing you have to consider is, what do you want to achieve ? The way you're writing the file, you're getting an 8 bit greyscale image, if you put this info into an 8 bit bitmap with a palette that went evenly from 0,0,0 to 255,255,255, it would work. You're only writing out one colour value as far as I can see, and you're now correctly calculating the grey value. Therefore making your bitmap 8 or 16 bit internally will only result in messy calculations to get to the same point you're reaching now. Please correct me, but I believe you're writing out one unsigned char per colour, although you're making the variable an unsigned long, it will still be between 0 and 255, yes ?
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|