|
Hello guys,
I'm new to MFC. I made hardware image grabber board and get the digitized image data from it. The one pixel data of it is organized as 4 byte(DUMMY(MSB) + R + G + B(LSB)).
I already made device driver and application code for this grabber board running on Windows 98 and it works fine. I used this routine for display image.
......
CClientDC dc(this);
CBitmap bitmap;
CDC dcMemory;
dcMemory.CreateCompatibleDC(&dc);
bitmap.CreateCompatibleBitmap(&dc, m_Width, m_Height);
memcpy(AppImageBuff, pDmaImage, m_Width*m_Height*m_BytesPerPixel);
bitmap.SetBitmapBits(m_Width*m_Height*m_BytesPerPixel,AppImageBuff);
dcMemory.SelectObject(bitmap);
dc.BitBlt(40, 60, m_Width, m_Height, &dcMemory, 0, 0, SRCCOPY);
...........
AppImageBuff contains image data, array of DWORD.
Now the problem is I have to do the same task in Windows CE where I can't use API function "SetBitmapBits()". How can I display image data without using SetBitmapBits?
Please help.
Morii
|
|
|
|
|
Wow - this sounds SO cool !!!
If you can create a DIBSection instead of a CBitmap, you'll get a pointer to the data which you can then feed your bytes into. There is a DIBSection wrapper by Chris on this site, it's probably a great place to get started. A DIBSection is device independent ( which you want anyway because you need to be able to make and show a 32 bit image regardless of screen depth ). I'm surprised the above worked, I thought you'd need BGRA, and you have it the other way around - did I miss something ?
Christian
I've learned that you cannot make someone love you. All you can do is stalk them and hope they panic and give in.
The early bird may get the worm, but it's the second mouse that gets the cheese.
|
|
|
|
|
If you look at your menu items in the Class Wizard, you have two options to add handlers for. The first is for when a menu item is chosen, the second is OnCommandUI, which handles the menu item. It takes a pointer to the menu item in question, and you can disable it, enable it, etc. there. It is called just before the item is shown, so it always tests the variables you are checking at just the right moment.
Christian
I've learned that you cannot make someone love you. All you can do is stalk them and hope they panic and give in.
The early bird may get the worm, but it's the second mouse that gets the cheese.
|
|
|
|
|
First of all, I am sorry for a stupid question.
I don't like MFC and always write projects without it (but I like Visual C++).
Mostly I work with interfaceless projects, some of which run under several platforms. The only thing I need now is to help to modify the old MFC project ASAP.
Also I am sorry that I have subscribed by the name of my friend (who seats on the machine I am working on now and who is really high-qualified specialist not only in interfaceless projects, but also in GUI). He has already came and helped me, but he didn't like this joke. He has his own login and password on this site and he never worked anonymously. I am sorry, Wassily! My real name is Vladimir
Vladimir
|
|
|
|
|
Well, I'm confused. In the first instance, I am right, unless your question was worded very poorly. Are you not using MFC then ? That's cool, but you should specify. I'm still not sure.
Secondly, do you still need help ? If so, please restate the question.
Christian
I've learned that you cannot make someone love you. All you can do is stalk them and hope they panic and give in.
The early bird may get the worm, but it's the second mouse that gets the cheese.
|
|
|
|
|
I'd like to monitor windows messages (of other application) in order to caught the text and to access to the buttons from my program. I think that I've to use "hooks" but I don't find good information and examples of them. Help me, please!!
Thanks in advance,
Luis.
|
|
|
|
|
Does anyone know how to convert between RTF and HTML?
I'm using VC6 with MFC.
Thanks in Advance.
Robby Diener (RDiener@gsd-software.com)
|
|
|
|
|
Is there a way to load an executable directly from disk into memory, an then tell to windows to execute them from some memory location?
thank you anyone
|
|
|
|
|
ummmm
ShellExecute() or CreateProcess() ...?
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
Maybe I've not correctly post previous message.
I miss to tell you that the file have not exe extension or if hit is stored inside another big file like a package!
Thank you for the greatful phrase.
|
|
|
|
|
Hi All
I use WinNT4.0, VC6.0. My requirement is to retrieve all the eventlogged messages of a specific APplication by Name say SampleApplication..., but i see from MSDN that it's possible t o retrieve the evenloged messgaes by classifying System, APplication,.. or so & no t by a specific application name.
Is there any way???
Right now, my approach is retireve all teh application messages of the event log & filter it by searching for my application name which is time consuming & ugly too.
Any help would be very useful.
regards
Sankar
|
|
|
|
|
Please help me. I want to use a CSplitterWnd in a ActiveXControl. Is it possible. How can i do it?
Ricky
|
|
|
|
|
Does anyone know how to create a picture control dynamicly with extended_style property of transparent?
Thanks
|
|
|
|
|
What do you hope to achieve ? Transparent will not give you a translucent image, or allow you to set a transparent colour, or anything remotely like that.
Christian
I've learned that you cannot make someone love you. All you can do is stalk them and hope they panic and give in.
The early bird may get the worm, but it's the second mouse that gets the cheese.
|
|
|
|
|
We have a big project me and another programmer (friends) "we want make a Napster style application" and we need the help of everybody who want to participate. It's for freeware only !! if your are interest send me an E-mail at :
mpblaze@iquebec.com and tell me what do you want to do on the project, like the interface or a part of code and tell me your name !!
P.S Absolutly contact me by e-mail, I don't have time to search in the board
BLaZe
|
|
|
|
|
Greetings,
I was wondering if anyone knows how to do Audio Fading with Direct show?
I am trying to fade the audio of a file that is playing in a playlist type of app, are there any samples that I could look at?
Thanks in advance.
|
|
|
|
|
Please help,
In VB, the GetSpellingSuggestion() return a Set data structure, but in VC++ it returns LPDISPATCH.
VB function:
For Each wd In ActiveDocument.Words
Set sugg = wd.GetSpellingSuggestions
If sugg.Count <> 0 Then
For Each ss In sugg
MsgBox ss.Name
Next ss
End If
Next wd
Can anyone help me to deal with LPDISPATCH so I can get the result from the GetSpellingSuggestion method in VC++.
Thanks in advance
|
|
|
|
|
Hi;
I've been looking (texts, help, forums, the net) for something I assume is simple, but I can't find the "magic formula".
I would like to display any old Unicode character in a CRichEditCtrl. The language I support (Pali) uses Unicode characters over a very wide range in Unicode. My MS Word 97 can display the characters (using Insert Character). I can use the Unicode characters in my code, but I can't get them to display properly in the edit control (I get the default symbol). My font is "Arial Unicode MS".
Does anyone have a skeleton 1-2-3 for this?
BTW: a useful Unicode tool Unibook 3.0 is a free download at
http://www.unicode.org/unicode/onlinedat/resources.html
Thanks and peace from
Andy
http://members.home.net/j-andrew-shaw/
|
|
|
|
|
Hello, the codegurus around the world.;)
Try this.
This works to show Japanese in CRichEditCtrl.
BOOL CMyDialog::OnInitDialog()
{
CHARFORMAT cf;
CMyRichEditCtrl.GetDefaultCharFormat(cf);
cf.dwMask = CFM_CHARSET | CFM_FACE |CFM_BOLD | CFM_SIZE;
cf.dwEffects = CFE_BOLD;
cf.bCharSet = DEFAULT_CHARSET;
cf.yHeight =150;
CMyRichEditCtrl.SetDefaultCharFormat(cf);
Have a nice day.
-Masaaki Onishi-
|
|
|
|
|
#include<stdio.h>
void callDllFunc(char *, char *, ...);
void main()
{
char *szDllName = "USER32.DLL";
char *szFuncName = "SetWindowTextA";
char szDataType[40];
int numArgs, counter;
void *receptor[20];
printf("Enter the number of arguments SetWindowTextA takes: ");
scanf("%d", &numArgs);
for(counter = 0; counter < numArgs; counter++)
{
printf("Enter the datatype of arguement %d: ", counter+1);
scanf("%s", szDataType);
switch(*szDataType)
{
case 'i':
printf("Enter an int value: ");
scanf("%d", receptor[counter]);
break;
default:
break;
}
}
}
I want to take a variable number of arguments of any time. The user in this case wants to call a function within a Dll and he knows the number and types of the arguments. My problem is how do I take those arguments from the use and pass them on to the Dll? (callDllFunc will take the name of the Dll, the name of the function, and the arguments to be passed to the Dll function)
|
|
|
|
|
Can someone show me an example program on the use of the ellipsis (...) to be able to recieve an unspecified number/types of arguemtns at run time.
|
|
|
|
|
take a look at the MSDN for va_start, va_end or va_arg
-c
------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|
|
I posted the following message a couple of days ago but haven't received a single reponse yet. I was wondering if it is the way I describe the problem or it is just too difficult to takcle with.
I am still struggling here hoping someone can point me to the right direction.
*******************************************************************
In my project, I declared a toolbar button structure TBBUTTON.
And loaded up some bitmap buttons dynamically into the toolbar by using toolBarCtrl.InsertButton( 0, &button ); in a for loop.
Then I set TBBUTTON's state and style as
button.fsState = TBSTATE_ENABLED;
button.fsStyle = TBSTYLE_BUTTON;
The problem now is that only 2 out of 10 buttons are being displayed on the toolbar. The rest of the buttons somehow got hidden in the back.
By resizing the window a little bit or toggling toolbar(show/hide), all the buttons get showed up. Obviously all the buttons are loaded up properly at run time but some buttons are just stay back invisible. If I drag and move the window around rather than tweaking the window size, those buttons are still hiding in the background.
Any thoughts what might caused this problem? Any suggestions on how to resolve that?
By the way, how I can modify my window's size just a tiny bit(I mean the SLIGHTEST change in either width or height. I wrote something like this, it solved that hidden button problem but the window gets changed the position too much.
CRect rect;
GetClientRect( &rect );
SetWindowPos( NULL, rect.left, rect.top, rect.Width(), rect.Height()+ 1/1000, SWP_NOZORDER | SWP_NOMOVE);
Thanks,
Allison
|
|
|
|
|
Are you calling RacalcLayout()?
|
|
|
|
|
I didn't call RecalcLayout(TRUE) before. But I just add that line into my code. It still does not help. What I am trying to do here is change window's size a little then resume it back to its original position without being noticed by end user. It is not working! Everytime I run the application, the window gets shrunk in its height. Any ideas? Thanx.
CRect rect;
GetClientRect( &rect );
int x = rect.left;
int y = rect.top;
int cy = rect.Height();
int cx = rect.Width();
// move RecalcLayout() after SetWindowPos(), still the same
RecalcLayout(TRUE);
SetWindowPos( NULL, rect.left, rect.top, rect.Width(), rect.Height()+ 1/1000, SWP_NOZORDER | SWP_NOMOVE);
// resume window to its previous position
SetWindowPos( NULL, x, y, cx, cy, SWP_NOZORDER | SWP_NOMOVE);
|
|
|
|