Click here to Skip to main content
Email Password   helpLost your password?
Unanswered questions View unanswered questions in the C / C++ / MFC forum    RSS: RSS Feed
Home > Forums > C / C++ / MFC

You must Sign In to use this message board.
 
 
Per page  Date Filter 
 FirstPrevNext
QuestionNewbie to MFCs (Image Processing help)
vishal_c
13:42 20 Nov '09  
I am working on a project to create a Visual C++ application that loads a grayscale image (bitmap) and performs basic image processing tasks like Zooming/Shrinking, Histogram equalization, basic filtering in both spatial and frequency domains, noise reduction etc. Now I have some basic exposure to C++ coding before but I've never worked with VC++ before and am completely lost trying to build the "app" from the code (which typically involves operating with the pixels). I am told MFCs are the way to go, but it seems too complex for a beginner.

So I was just wondering if someone can help me/point me towards a place where I can get a sort of a basic skeleton MFC which, say has the window and the menus (with the various tasks) designed and can open an image file and extract the pixels from it.

I hope it's not too much to ask for. I am an Electrical Engineer by background and have had not much coding experience before and although I have the logic for this project figured out, I'm running into a brick wall when it comes to coding it. Any help will be much appreciated. Thank you.
AnswerRe: Newbie to MFCs (Image Processing help)
LunaticFringe
13:53 20 Nov '09  
vishal_c wrote:
I am an Electrical Engineer by background

Heh - me too.

Big Grin

Run Visual Studio and select File/New/Project to open the new project dialog. Select VC++, MFC, then MFC Application.

You're probably going to want a Single Document Interface (SDI) project type (but mabe not... depends on what you have in mind). This'll generate a skeleton project for you. There are a lot of project options you can specify; play around and seen the differences in the wizard-created code for the various options.

There's also a fairly decent tutorial called 'Scribble' that demonstrates a lot of the basics of VC++ project development. If you have the time, it's worth working your way through it.
QuestionHook calls to an API?
Omnicoder
11:09 20 Nov '09  
How would I go about hooking Explorer so that any calls to BitBlt get hooked and my application can use the parameters explorer was trying to pass to do something else with them?
AnswerRe: Hook calls to an API?
«_Superman_»
11:54 20 Nov '09  
Here is a good tutorial on API hooking - API hooking revealed[^]

«_Superman I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++)

QuestionNetwork Drives
Bram van Kampen
9:56 20 Nov '09  
Is there a way to determine if a Drivespec, say "F:" refers to a Volume F: on 'this' computer, or whether it is a 'Mapped' drive elsewhere on the Network.

Regards,
Smile

Bram van Kampen

AnswerRe: Network Drives
«_Superman_»
10:19 20 Nov '09  
GetDriveType

«_Superman I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++)

GeneralRe: Network Drives
Bram van Kampen
10:30 20 Nov '09  
Thanks,

Does the Trick Nicely.

Regards,

Bram van Kampen

QuestionHandle to child windows in Start Menu?
yeswekey
8:00 20 Nov '09  
I'm able to find the handle to taskbar using FindWindow("Shell_TrayWnd", NULL);

But I want to find the handle to the window containing the text "Run...". I want to change it. It should change to different values at different time. So I can't patch Explorer.exe

I wanna change its text dynamically using SetWindowText, change its styles etc.
Or create some effects like bounce (by movine the window using some mathematical equation)

I tried EnumChildWindows but that doesn't help me.

Plz tell me a way to get handle the child window that displays "Run..."

I want to change the text, move the position and just play around with it! Big Grin

(Just a hobby project)

-
S.V.Kaushik

AnswerRe: Handle to child windows in Start Menu?
«_Superman_»
8:19 20 Nov '09  
The Run window is not a child of Shell_TrayWnd.
This is why EnumChildWindows doesn't work for you.

The Run Dialog is an independent dialog whose parent is the desktop.
In your case you can get notification that a dialog is appearing by writing a global shell hook using SetWindowsHookEx.
Check if the dialog is the Run dialog and then change its title.

«_Superman I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++)

GeneralRe: Handle to child windows in Start Menu?
Omnicoder
11:11 20 Nov '09  
He is reffering to the Run button in the start menu that makes the dialog appear, not the dialog itself.

Have you tried the Krypton Toolkit? http://www.componentfactory.com/free-windows-forms-controls.php

GeneralRe: Handle to child windows in Start Menu?
DavidCrow
11:13 20 Nov '09  
His suggestion still remains, however. You first have to get access to the dialog before you can worry about any captions or controls on it.

"One man's wage rise is another man's price increase." - Harold Wilson

"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons


GeneralRe: Handle to child windows in Start Menu?
Omnicoder
11:15 20 Nov '09  
If you mean you have to get the start menu 'dialog'/popup before getting the "Run" button on it then I agree.

Have you tried the Krypton Toolkit? http://www.componentfactory.com/free-windows-forms-controls.php

GeneralRe: Handle to child windows in Start Menu?
yeswekey
20:22 21 Nov '09  
Even GetMenu fails!

I want to find the coordinates of "Run..." that appears in the start menu.

Plz see this:
http://i626.photobucket.com/albums/tt346/yeswekey/run.jpg

I actually don't wanna change the text, but i want to find its coordinates Cry

-
S.V.Kaushik

Questionoperator over loading problem?
york528
7:22 20 Nov '09  
lately when I use STL map as a parameter in a function I have a problem?
such as:

void func(const map<struct>& mapUsed)
{
map<struct>::iterator iterMap = mapUsed.begin()
while(iterMap != mapUsed.end())
{
//do something
}
}

The vs2008 report an error and when I use const_iterator to instead random iterator
It's ok

And I wanna know If STL use "const" overloading such as operator == ...
If not ?
How dose STL do?

Thanks a lot! D'Oh!
AnswerRe: operator over loading problem?
josda1000
9:17 20 Nov '09  
map<struct> should be more like map<int, int> or something. you're indexing one type of thing to another type of thing. you're not just making a vector of structs. even then, if you are making a map of int->structs, then the data type has to be used. the map must know how large of an allotment of memory it has to block off for each part of the map. hope that made sense...
GeneralRe: operator over loading problem?
york528
23:43 20 Nov '09  
Hi,

I'm sorry that I made a mistake!

what I mean is when I use STL::map or else

Using iterator as a left value and a map&amp;lt;X,Y&amp;gt; as a parameter of a function

as bellow

void func(const map<X,Y> mapUsed)
{
map<X,Y>::iterator iterMap = mapUsed.begin(); //IDE report wrong here
while(iterMap != mapUsed.end())
{
//do something
}
}

mapUsed.begin() returned a const_iterator

it dosen't match with iterator

I was confusing that how dose mapUsed know itself is a const one and return const_iterator

Did the IDE do it for us or STL used some other way?

Thanks a lot!
GeneralRe: operator over loading problem?
Lim Bio Liong
23:25 22 Nov '09  
>> I was confusing that how dose mapUsed know itself is a const one and return const_iterator...

It depends on how "mapUsed" is declared for the function func :

void func(const map<X,Y> mapUsed)

since "mapUsed" is declared as a const, the compiler naturally uses the const_iterator.

- Bio.
GeneralRe: operator over loading problem?
york528
19:14 23 Nov '09  
I thought it is about the program language

Now I know the complier do this, Thank you

Poke tongue
GeneralRe: operator over loading problem?
Lim Bio Liong
0:10 24 Nov '09  
Most welcome york528   Smile
Questionpow function appears to fail randomly.
Member 2088
7:21 20 Nov '09  
This my program

int _tmain(int argc, _TCHAR* argv[])
{
int a=0;
double b=10;
double result = pow(b,a);
double r=0;
for(int aa=0;aa<30000;aa++)
{
for(int i=0; i<30000;i++)
{
for(int j=0; j<30000;j++)
{
r = pow(b,a);
if(r != result)
{
int error =0;
}
}
}
}
return 0;
}
I put a breakpoint on the int error = 0. It got hit when aa=0,i=19383,j= 26848.
Could this be a hardware problem or something else?
Running VS2008 with latest service packs.
AnswerRe: pow function appears to fail randomly.
Richard MacCutchan
7:43 20 Nov '09  
Member 2088 wrote:
I put a breakpoint on the int error = 0. It got hit when aa=0,i=19383,j= 26848.

What were the values of r and result at the time of failure?
GeneralRe: pow function appears to fail randomly.
Member 2088
8:03 20 Nov '09  
When it hit the error line
r = -1.#IND000000000000
a and b are correct.
GeneralRe: pow function appears to fail randomly.
Richard MacCutchan
8:14 20 Nov '09  
Member 2088 wrote:
When it hit the error line
r = -1.#IND000000000000
a and b are correct.

So what were the values? Also I asked what the value of result was.
GeneralRe: pow function appears to fail randomly.
Member 2088
8:46 20 Nov '09  
b=10.000000000000000
a = 0
result = 1.0000000000000000
GeneralRe: pow function appears to fail randomly.
josda1000
9:09 20 Nov '09  
Is this really the intent of the program, to never change "a" or "b"? because in this case, you'll always get a result of 1. So you'll be going in a double-nested loop for a long time to just get a result of 1...


Last Updated 10 Aug 2007 | Advertise | Privacy | Terms of Use | Copyright © CodeProject, 1999-2010