Looking for source/hint how to create read/write thread lock

I am looking for a suggestion, or already functioning source (MFC, raw) of a "smart" read/write thread lock. It is a kind of object that will yield threads requesting full access to a shared resource before threads requesting read only access to a shared resouce, and schedule them in that ...

Help with extending a Bitmapped MFC Dialog size - BitBlt problem

I have an MFC Dialog that is Bitmapped using CBitmapDialog by David Forrester.I need to increase the vertical size of the Dialog during runtime by a multiple of 32 pixels multiple times, I use SetWindowPos() to increase the size, which works. When I increase the size by 32 pixels, I copy the two bot ...

(MFC) Getting a bitmap to be displayed using BitBlt

Alright, well I HAVE to use MFC for a class. And I'm working on a pacman clone. Here's the problem, I'm not familiar with bitblt(), I've used the msdn, and help files and I just can't seem to get it to work. I'll show you the code I'm using now (no errors/warnings).I tried this in an OnPaint() even ...

How to get raw data from MFC arrays and restore it on the remote PC?

Does anybody know the simple and generic way (also fast) how to get raw data from MFC arrays, transfer it to remote machine (DCOM) and restore there to the same array? It's in custom interface so I don't bother about Automation. As far as I understand MIDL doesn't allow MFC specific parameters in CO ...

BitBlt with a raw array

I'm using ffmpeg to stream video. I can get RGB24/RGB32 data into a simple pointer array, lets say char* stored row by row. I'd like to use BitBlt to render this to screen, rather than use an SDL control to play back my video. That way I can write a custom app.What I dont get is how do I create a DC ...

MFC Socket Serialization truncated my raw data.

I am using MFC Serialization to receive some raw data. However, it always deleted my data from 0x00 byte. I just observed the memory and found the raw data received. But the MFC Serialization "ar" processed data into character string. How do I change it back to raw data ?m_strText is one m ...

BitBlt ? MFC ??

Hmmm.... i tried using bitblt to transfer bitmaps to a seperate CDC object and then bitblt that CDC object to the main display.for some reason that is not allowed.... i can bitblt bitmaps right to the client rect easily enough using pDC->BitBlt(....,&BmpDC)but when i try to ((Emulate)) the Di ...

Does anyone know anything about using BitBlt in MFC?

It seems no one uses bitblt, i've checked here and a few places on irc, and on one knows. All I need help with is displaying a bit map using it...... I have my source, if you want to look at it to help me out....... ...

Problem integrating MFC GDI DirectDraw

I have a program that uses MFC Dialog, GDI and DirectDraw to bounce a ball around a screen.I have got it all working with 3 standard timers set at 1 ms 50 ms 1000 ms and a high performance timer.I am using GDI to double buffer and bitblt and i am trying to use Directdraw to take this and avoid teari ...

Black Drawing with BitBlt using a off CDC

i`m stuck with this black bitmap that keeps showing if i use a offscreen CDC (memory CDC). there you get my code snippet.i`ve resumed the code so you guys can take a look, this one is inside my OnPaint (i`m using MFC and VS2k8).CPaintDC dc(this);CRect rcWndBnds;CDC memoryDC;CImage imgBackground;CIma ...

Double Buffering MFC

I'm trying to implement double buffering in my MFC application. To do this I have add some code to my OnDraw method. But if I do this I don't see anything on the screen. The code is this:void CGOEView::OnDraw(CDC* pDC) { CGOEDoc* pDoc = GetDocument(); int i=0; ASSERT_VALID(pDoc); if (!pDoc) return; ...

Is MFC 'Old School' ... should I be learning .NET ?

I'm a raw beginner and very confused about where I should be focusing my learning.Should I focus on Visual C++ .NET with CLR/CLIorShould I focus on Visual C++ MFCorSome other version of C++..... ...

MFC custom control using 100% CPU

Well, I have created a custom MFC control that derives from CWnd. I have done some work to add double buffering, but now i have a problem. My application sucks up 100% of the CPU.I have it narrowed down to one line.void CGameArea::OnPaint(){//CWnd::OnPaint(); //PROBLEM HEREmPlayer->Draw();//BitBl ...

Increase in number of handles while using CDataBase- MFC Class

I am developing a dashboard kind of engineering applicationthe application takes data from the database and present it to the user ,during which the application also processes ceratain the raw data to incorporate some business logics before presenting it to the userthis display is a auto refreshing ...

Mixing C and MFC C++

I am working on this project where I have to implement a decoder/video player. I have a decoder project written in raw C. It takes an encoded file as input and generates a decoded file. I have another project, a video player, which is an MFC implemented in C++. What I have to do is incorporate these ...

Getting started in MFC, good links?

I have been using the windows API for some time now and feel quite comfortable with it. I know for larger projects MFC is a better choice over the raw API. I've been google searching for some good tutorials on MFC but haven't really found any good ones like I found with the windows API (Johnnie's Tu ...

problem with MFC

as in the topic, I wrote a program in MFC, the program has to draw a line, or two, doesn't matter how many lines. On my teacher's website there's an instruction how to write such a program. I followed the instructions. There're no errors or anything else at the end of the compilation. Program works, ...

help! can't BitBlt !!

I really don't know what I'm doing wrong...I have a simple dialog (MFC), and I want to create a buffer, paint some pixels on it, and BitBlt it onto the dialog's client area.In my dialog class I've created a new DC member:CDC m_PicDC;In my OnInitDialog method I create it to be compatible with my dial ...

Forcing an MFC dialog onto a window

I am writing a dll file that uses a class from an API to create a window. This window is used as a panel in the software I interface with and the dll is a sort of a plugin. Now, I am more comfortable with MFC than raw win32, so I wanted to force an MFC dialog onto that window so I can use MFC to man ...

How to display a Bitmap Picture in MFC Project

Hi, I have this MFC porject in which I have imporetd a Bitmap. I want to be able to display the bitmap as shown in the figure below. What I really want is a function that does the displaying when called. Also I only want to be able to use the resource id to do this. Please advise. I found this code ...

Question about raw input

I am working on a project which need use raw input. The application is a MFC dialog based window. It need distinguish input message between two mice. After registering a raw input class (mouse device, and no legacy mouse), all legacy mouse message will be disabled. The windows message handler such a ...

What's the hype about MFC?

I was just curious, I've recently started win32 programming and windows applications, and I wanted to know what's the big differences between C++ and MFC, and how to tell the difference in code. Is MFC the code that usually has the prefix C in it? A lot of the source codes I've seen on this site see ...

Copying non-MFC data to/from the clipboard

I've got a complex non-MFC data object that I am accessing from an MFC MDI application.I am have full access to the object and I am trying to copy it to the clipboard for use in one of the other windows.Every tutorial or help file that I have found for the clipboard seems to assume the object being ...

Sending raw packets

Can anyone tell me how I can send a raw packet with the MFC CAsyncSocket interface? If it can't be done with CAsyncSocket, then how can I do it? Right now I'm using SOCK_DGRAM for sending and receiving packets. ...

Image Display using OpenGL + MFC

I am using OpenGL in my MFC based Dialog App. In that i need to display the image (.PNG format) on the screen using OpenGL. But it gives the error. But if i display the image without OpenGL using BitBlt it works. How i display the image using OpenGL. ...

Displaying raw RGB bitmap to screen

I want to thank everyone that has helped me in earlier to get this program going. I think doing this program as my first MFC/VC++ program is pretty tough. I have finally gotten to the point where using the FlyJacket, I capture the image in raw RGB code and am able to save it as a bitmap. What I want ...

Screen resolution in my MFC C++ project

Hello, i'm developing a game in VC++ 6.0 with MFC. My screen resolution is 1280x1024 pixels, so i have a background bitmap with this size. The problem is when i change the resolution to be smaller, some parts of the pictures are not seen. I'm using BitBlt() function to display the bitmap.I need to m ...

Win2000 MFC problem *LONG*

I've got an MFC based application that works well under Win9x, but when I try it on Win2000 I've got an Access Violation (0xC0000005) error opening a particular dialog (the application works until the dialog opens).I've got this log created by DrWtsn32:Microsoft (R) Windows 2000 (TM) versione 5.00 D ...

CDC->CDC BitBlt dont work (simple double buffering question)

good day sirs.Im new with VC MFC coding so I have question. I've created project using project wizard (MFC exe with single document support) that contans this class:class CChildView : public CWnd {....} This class has OnPaint method I've reloaded with this simple test code:void CChildView::OnPaint() ...

How to send RAW SQL queries in Database App

I'm more interested in using a class which allows to send RAW SQL queries, rather than using CRecordset::m_strFilter or alike. I think MFC framework is confusing when you need to perform complex SQL Queries (as in nested queries, SELECT+GROUP+HAVING, etc). Having it said, it would be even usefull to ...

Problems using Bitblt

I'm having difficulties getting BitBlt to function proparly using Visual C++ with MFC.I whant my picture to be displayed with the start point in 0,0 of my client window. But When I bitblt it, it appears more like 40,0 (x,y). But I have set the coordinates correctly in my code:pDC->BitBlt(0,0,1024 ...

Ubuntu 8.0.4 and Brother MFC 465CNprinter

Before I start I would just like to say hello to everyone on the forums. My main reason for joining is to tap into the wealth of knowledge that you all have regarding Linux and its different variations.I have used computers and mainly ...."shush" MS OS and software from the mid 80's and as ...

Slow CreateCompatibleBitmap() and BitBlt()

I am experiencing extremely slow performance when using the MFC CBitmap::CreateCompatibleBitmap() and CDC::BitBlt() to copy compatible bitmaps between device contexts. Sometimes the calls are extremely fast, as expected from the wealth of documentation that recommends using memory bitmaps to optimiz ...

good way to refresh the whole screen? (no mfc)

everyone. I'm trying to refresh my main window in a win32 program (not mfc) because I draw a bitmap (in the WM_PAINT part of the main window procedure), and it will show up only after I minimize, them maximize it. To make this work, i'm trying to send a message in the correct place but it isn't work ...

problem creating memdc and using bitblt

Ok, I have a simple MFC app and in the onpaint, i have the following:CPaintDC dc(this);CDC memDC;memDC.CreateCompatibleDC(&dc);memDC.Rectangle(CRect(10,10,260,260));dc.BitBlt(0,0,500,500,&memDC,0,0,SRCCOPY);but the bitblt won't draw back to my dc!!! I wanted to use this to swap buffers and g ...

mfc question

I'm writing an app which uses many mfc controls. I am using subclasses of ScrollBars and DialogBars, TreeCtrls and some raw CWnds each of which require a common set of properties and methods. It would appear that subclassing CWnd at the object (as opposed to HWND) level would be the ideal solution.T ...

mfc question

I'm writing an app which uses many mfc controls. I am using subclasses of ScrollBars and DialogBars, TreeCtrls and some raw CWnds each of which require a common set of properties and methods. It would appear that subclassing CWnd at the object (as opposed to HWND) level would be the ideal solution.T ...

MFC - Problems with Canvas

I am a student studying MFC. I developed a card game. Naturelly the cards are bitmaps. I load the bitmaps into memory and then transfer them to the dc using BitBlt. The program works for some time and the crashes. The screen becomes distorted and the cards usually change. There is no consistancy reg ...

Refreshing problem with BitBlt()

I have a MFC based application,in which i do display an image through Bitblt().Image will be displayed,but if i move another window over that image ,image will be erased.Here is code,HDC hDC=GetDC()->m_hDC;::BitBlt(hDC, rcClient.left, rcClient.top,nSize, nSize, hMemDC, 0, 0, SRCCOPY);Can anyo ...

CPing without MFC

Does someone could indicate me a classe which implement a raw-socket based ping ? Looking around on the Net, I've found using MFC and/or some Windows 9x/NT DLLs, but nothing using winsock only.Does a pre-made class exists somewhere ...

how to display image in MFC windows?

I would like to display an image(myImage.raw), which is a raw image file type to a MFC window. How can i do this? Please,, ur help and hint is very much appreciated! ...

Socket question : can WSAAccept() be used with MFC sockets?

I am trying to incorporate BOTH CSocket class and win32 socket API into a single MFC program. The reason I am doing this is speed and realibility. MFC Sockets will be used within a single thread that owns my window, so that window can receive and route messages while my MFC CSocket listens and accep ...

not MFC

Is there a method to use the access data class, like CRecordset or CDatabase, without using MFC but using the "raw" programming in C?Infact I hate MFC and usually I use "pure C" to program in Windows. ...

OLE Document Servers, WITHOUT MFC

I´m searching one example, or a tutoria, or whatever... that implements an Ole Document Server but without using MFC, it would be ok raw C++, and even better ATL.Does anybody know where can I get such thing ( the ActiveDoc sample from ATL doesn´t work quite right out of Microsoft Binder, can anybo ...

Drawing images in MFC

I'm new to MFC. I'm trying to write an image viewer. My internal data structure stores images similar to what the raw PPM format is: 2D array of RGB values.When I draw my images to the screen, I use two for loops and SetPixel(...) for each one. This is probably the worst way to do it, but I know no ...

BitBlt, I try, I fail, I read, try somemore and still nothing

I am trying to reduce flicker in my applicationvoid CCalenderClass::OnPaint() {CDC* pDC;CDC DC;PAINTSTRUCT ps;CRect Rect;GetClientRect(&Rect);pDC = BeginPaint(&ps);DC.CreateCompatibleDC(pDC);Cal3DDraw(&DC);GridHitLoad(&DC);GridDraw(&DC);PaintNum(&DC);::BitBlt(pDC->m_hD ...

Help! Menus in MFC

I am a raw beginner at MFC, just created a Hello World type app from a tutorial,just opens one window (not using AppWizard) with a few controls. But I cannot get a simple menu (on the frame window) to work! I'm just tinkering with different functions and trying to find stuff on the web. The menu dis ...

Raw Ethernet communication

I'm doing some development on a embedded project, where I have a 10/100 MBit Ethernet device on. During software debug/development, it would be nice to be able to generate RAW data on the Ethernet from within a MFC program. I have seen references to the SOCK_RAW type, but I'm not sure that it allows ...

Bitblt to OpenGL surface

I am writing an MFC-OpenGL program. I have all the usual device contextsand so on. I need to copy a background into the colour AND depth buffersevery frame. I can do this using glDrawPixels, but it is horribly slow,(15fps max) and this is supposed to be a real-time program. Is it possibleto use bitb ...

CFormView with raw win32 apis

I'm trying to write an application with raw win32 api's, and I'm having trouble figuring out how to create a dialog resource and use that in the main window (a regular, overlapped, window -- i.e., not a dialog, i.e., created with CreateWindow()/Ex()). Sort of like a CFormView in MFC. This will save ...