|
|
Thanks Tomasz,
whilst I'm sure I'm doing more than I need to do, the following seemed to get things working for me.
1) setting the psp flags within the constructor (not OnInitDialog)
2) adding the WM_HELP handler (called WM_HELPINFO from ClassWizard)
3) adding an ON_BTN_CLICKED handler for ID_HELP.
Seems more work than I thought, but works a charm.
Thanks for your input.
Regards,
Ray
|
|
|
|
|
Hi,
Can anyone point me in the right direction of creating an app with an embedded word document.
I don't know where to start.
Cheers
Rich
|
|
|
|
|
Hello!!
I am writing a TAPI program in which there are two appliations.One for the server and one for the client.
When I am dialing from the client it reaches the server and then the server calls lineAccept(). The lineAccept also succeeds. It then goes to LINE_REPLY of teh server and it gives error there i.e the dwParm2 value is negative... The dwParam1 paramater(dwrequestID) of the lineCallBackFunc is same as the return value of the lineAccept().
The error is LINEERR_OPERATIONUNAVAIL which means:
The operation is not available, such as for the given device or specified line.
We have no idea as to why this error is occuring..
Please help..
Sandeep
|
|
|
|
|
Hi!
I am a newbie, and trying to to some very simple VisualC++ stuff. I have a bit of a newbie question regarding updating of a windows client area when the window has been, for instance, covered by another window or minimized/restored.
I am putting pixels on the client area via the windows dc using the CDC::SetPixel(...). When all pixels are put, I would think they are stored somewhere for Windows to automatically redraw the client area when needed. Am I wrong?
Or must I create my own place for the pixels (like a CBitmap?) and try to re-display the bitmap in a OnPaint message handler (or another propriate handler)? Or what need I do?
I am not using the Doc/View architecture (if that would have taken care of this for me), only a simple CFrameWnd derived window.
Would be very grateful for any input!
|
|
|
|
|
Or must I create my own place for the pixels (like a CBitmap?) and try to re-display the bitmap in a OnPaint message handler (or another propriate handler)?
Windows doesn't store the window contents for you. You have two options:
1) always redraw the pixels in OnPaint
2) draw pixels in off-screen buffer (using CBitmap and memory device context), then BitBlt in OnPaint. There's a class called CMemDC somewhere on this website - it should make this easier.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Thanks for answer!
I try to move the pixel-filled dc by Blt:ing the drawn area to a CBitmap member in my class. I try to do this by following the advice in the Reply I found on another thread (see reply at bottom of this).
When I try to do this and before doing the BitBlt, I first create a 'dummy' CDC object and then do SelectObject(...) my CBitmap into this dummy CDC. When I do this I get ASSERT failure... does my dummy CDC need to be initialized in someway? MUST I attach it to a window or anything? (It's members m_hDc and m_hAttribDC are both 0.)
Re: How do I 'fill' a CBitmap with a DC's 'image'
Jonathon Lockett 19:31 8 Jul 01
If you've got a DC and you want to copy it to a CBitmap, just select the CBitmap into another DC and Blt across.
Jonathon
|
|
|
|
|
No bother!
I never did a CDC::CreateCompatibleDC(...) on my dummy CDC.
It now works!
Many thanks for your effort.
|
|
|
|
|
You need two objects:
1) a memory device context (use CreateCompatibleDC)
2) a bitmap (use CreateCompatibleBitmap and pass the same DC as the one passed to CreateCompatibleDC as 1st arg)
You should select a bitmap into memory DC, draw the pixels. In OnPaint handler just BitBlt from memory DC to CPaintDC.
All this stuff is encapsulated by CMemDC class available right here on CodeProject. Give yourselft a favor and search for this.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I'm writing an USB camera-capture program using DirectShow. I've succeeded previewing and writing the captured stream to an AVI file. But the written file is very slow because it isn't compressed. I don't know how to add a compression filter into the capture graph. So I've added some code fragment about compression filter, but it didn't work. How can I work with a compression filter??
Here's my code fragment.
// File-Writing section - capture
// Capture Filter Graph
ICaptureGraphBuilder2 *m_pBuilder = NULL;
// Filter Graph
IGraphBuilder *m_pGraph = NULL;
// Capture Filter
IBaseFilter *m_pSrc = NULL;
// AVI MUX Filter
IBaseFilter *m_ppf = NULL;
// File Writer
IFileSinkFilter *m_pSink = NULL;
// AVI Compression Filter (doesn't work!!)
IBaseFilter *m_pComp = NULL;
// omitted......
m_pBuilder->SetOutputFileName(&MEDIASUBTYPE_Avi, L"C:\\Example.avi", &m_ppf, &m_pSink);
// Creating a compression filter
CoCreateInstance (CLSID_AVICo, NULL, CLSCTX_INPROC,
IID_IBaseFilter, (void **)&m_pComp);
m_pGraph->AddFilter (m_pComp, L"Compressor");
m_pBuilder->RenderStream (&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video, m_pSrc,
m_pComp, // compression filter.
m_ppf // Default renderer.
);
// Rendering the streams - preview
m_pBuilder->RenderStream (&PIN_CATEGORY_PREVIEW, &MEDIATYPE_Video, m_pSrc,
NULL, // No compression filter.
NULL // Default renderer.
);
|
|
|
|
|
I need to write a module in VC to end ("terminate") a running exe file.
|
|
|
|
|
Take a look at the "kill"-sample in the MSDN
|
|
|
|
|
If its an windows application you could get the window handle with
FindWindow and than send the wm_quit message with SendMessage
|
|
|
|
|
<<< In the name of GOD >>>
Hi all,
First, i must say i didn't work with WinNT ...
I wanna know what is different between below ways to connecting to the database in server:
1- Using of file path:
\\\\Servername\\directory\\file.mdb
2- Using of connection string:
DBQ = ... SERVER = ... and ...
Is any different ?
My second question is about DSN ...
I know data source in server can be DSN file or MDB file ... So why i must use DSN ?
My Third question is about CDaoWorkspace ...
Please explain to me what is that ...
Is that for multiple access to database in server ?
In last please explain about WinNT operation system ...
Please explain about all of i need for learning database programming in connection between user and server(client and server) ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Any code to split and/or combine channels in a bitmap?
Best regards,
Paul.
Paul Selormey, Bsc (Elect Eng), MSc (Mobile Communication) is currently Windows open source developer in Japan, and open for programming contract anywhere!
|
|
|
|
|
If you use a DIBSection wrapper like the ones on this site, or the one in Paintlib then you can step through the bits in order to combine channels or split them into three seperate bitmaps. If you download paintlib, I wrote a colour filter that can be used to isolate a channel, I'd be happy to send it on to you.
LMK if my explanation makes no sense and I'll whip some code up to demonstrate. BTW, if you don't realse, Windows bitmaps are BGR internally.
Oh, if you want some code, LMK if I'm allowed to use GDI + ;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.
|
|
|
|
|
Thanks so much.
I will take a look at the DIBSection wrapper. I currently have a library that reads various image formats (many are not common to everyday user) and provides the channels. So the main requirement is to build the bitmaps from the channels and render them. Paintlib will therefore be overkill.
I have seen one channel splitter in Feng Yuan, but it has some limitations he explained and promised to update but never did
Any code will be highly appreciated, of course in the GDI+ domain
Best regards,
Paul.
Paul Selormey, Bsc (Elect Eng), MSc (Mobile Communication) is currently Windows open source developer in Japan, and open for programming contract anywhere!
|
|
|
|
|
I've spent the lions share of my work day buying and playing with a cordless, ball-less mouse, so I should proably do some work right now. I'll whip something up tonight though. What format do the channels come in from your existing library ? Do you want to see them in colour, or black and white ?
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 the support. There is not special format, an array of bytes (void* style) for the R, G and B-better still all the channels in image. Color, yes color, color...
I wish you all the best in this effort-thanks.
Best regards,
Paul.
Paul Selormey, Bsc (Elect Eng), MSc (Mobile Communication) is currently Windows open source developer in Japan, and open for programming contract anywhere!
|
|
|
|
|
you might want to take a look at ImgSource. It's a general purpose 2d image processing library. It prefers dealing with RGB images (as opposed to DIBs). It has many many functions for splitting, combining, overlay, rotation, resizing, sharpening, etc.. A whole lot of stuff..
-c
------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|
|
Thanks for the information. I have just looked at the ImgSource. It sounds very interesting. However, it has more features that I really need. All that will suffice for my work is
@ Generate HBITMAPs from RGB buffers
and may be
@ Generate DIBs from RGB or 8-bit images
Any other feature required could be obtained from the GDI+. Unfortunately, with these I cannot justify the cost ($75 + $50 every 6 months if you need the source) of the ImgSource to my boss. ImgSource is worth the cost, but we will use only 5% of it, if not less.
Best regards,
Paul.
Paul Selormey, Bsc (Elect Eng), MSc (Mobile Communication) is currently Windows open source developer in Japan, and open for programming contract anywhere!
|
|
|
|
|
I'm sorry to say we went out for dinner last night. I've put something together quickly, I hope it illustrates the point, if not LMK.
Bitmap bitmap(width, height, PixelFormat32bppARGB);
BitmapData data;
bitmap->LockBits(Rect(0, 0, width, height),
ImageLockModeWrite | ImageLockModeRead, PixelFormat32bppARGB, &data);
unsigned char * bits = (unsigned char*)data.Scan0;
for (unsigned int y = 0; y < data.Height; y++)
{
for (unsigned int x = 0; x < data.Width * 3; x+=3)
{
memset(bits[0], 0, 4);
if (we want the red mask)
bits[1] = source[2];
if(we want the green mask)
bits[2] = source[1];
if (we want the blue mask)
bits[3] = source[0];
if (we want the greyscale alpha mask)
bits[0] = source[3];
bits += 4;
source += 4;
}
bits += data.Stride - data.Width*4;
}
bitmap->UnlockBits(&data);
If this is confusing, broken, or not what you needed please LMK.
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.
|
|
|
|
|
|
How to get file status?
being read
being write
being opened
closed
Thanks
|
|
|
|
|
You can use CFile::GetStatus()
/Per
|
|
|
|
|