|
I use Visual studio C++.NET 2005.
Now I can execute the facedetect.c.
But I need to cut the photo which I detected.
Does anybody know how to write this function's code?
Please give me some example code to reference.
Thank you very much.
|
|
|
|
|
Hi,
I am developing a SDI app. I have disabled the System menu (Windows menu) and I display my own popup menu when the user clicks on the Icon on the title bar.
But when the App is minimizid, when the user clicks on the App in the taskbar, my custom menu doesn't show up.
Is there any way of popping up my own menu when the user clicks on the minimized app?
Thanks in advance,
Narahari Upadhya
|
|
|
|
|
How are you getting your menu to pop up? It sounds as if you're using WM_NCLBUTTONxxx, and I guess when it's in the task bar you don't get this kind of message - am I close?
If this is correct, consider using GetSystemMenu(FALSE) and *modifying* that menu to be what you want. I would suggest that it's 'controversial' to meddle with the standard user interface if you can find other ways to achieve your goal. It may be a simple case of disabling all standard items and adding your items to the end...
|
|
|
|
|
Thats right. I am handling WM_NCLBUTTONXXX to popup my menu.
The reason I don't want to use system menu at all is that I want to remove the default close, minimize and maximize buttons and add my own custom buttons there and hence I have to remove the system menu and show my own menu rather than modifying the system menu.
|
|
|
|
|
I tried manipulating the system menu to add my own menu items.. it works perfectly fine except that eventhough I have Removed the system minimize, maximize and close buttons and drawing my own buttons on top of them, Whenever I click on the title bar, the system close box appears everytime.
I heard its a XP related issue.
Is there any way of getting rid of the close button?
Thanks,
Narahari Upadhya
|
|
|
|
|
Hello everybody,
after resolving a strange error ( error during message queue by setting a pointer )
i put the char *BufferString from a lower place more higher :
from
class MyCEdit
{
public:
MyCEdit(.....);
ccc vvv;
bbb nnn;
protectec:
MessageLoop(.....)
public:
char *Bufferstring; <<<<<<<<
hhhh jjjj;
protected:
oooo pppp;
rrrrr tttt;
};
to
class MyCEdit
{
public:
MyCEdit(.....);
char *Bufferstring; <<<<<<<<<
ccc vvv;
bbb nnn;
protectec:
MessageLoop(.....)
public:
hhhh jjjj;
protected:
oooo pppp;
rrrrr tttt;
};
Now it works
Is it possible that more than one declaration of public or protected blocks makes
internal errors?
I'm really confused, because 6-7 months ago i had a similar problem and i "resolved" it the same way...
|
|
|
|
|
MessageLoop(.....) needs a ; .
Maxwell Chen
|
|
|
|
|
Yeah, and ..... as parameter is also false
|
|
|
|
|
baerten wrote: Is it possible that more than one declaration of public or protected blocks makes
internal errors?
No, it makes no difference. But, by simply moving member variables around, it's highly possible that you simply moved the problem, too.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks for help
Do you think there is a memory fault between the start of the class and my char*-variable?
At the time where i had a similar problem, i moved also the declared (and corrupt) variable line by
line higher, to find at which place the error occurs.
But there was no special pointer which could be allocated with a buggy class which could provoque
f.ex. a buffer overrun
|
|
|
|
|
baerten wrote: Do you think there is a memory fault between the start of the class and my char*-variable?
There's nothing wrong with the class declaration. You may be using it incorrectly, however.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
Nice Macro LOL
I'll test if i move the variable before and after macros
Thanks for the suggestion
|
|
|
|
|
baerten wrote: Nice Macro LOL
Yes! When I found this problem some years ago, as the cause of the bug in my project I was too happy: I closed my PC and went to the beach!
baerten wrote: Thanks for the suggestion
You are wellcome
Russell
|
|
|
|
|
I always make my own sections to separate from Wizard generated code. Such as:
class CBeeDlg : public CDialog
{
public:
CBeeDlg(CWnd* pParent = NULL);
enum { IDD = IDD_BEE_DIALOG };
protected:
virtual void DoDataExchange(CDataExchange* pDX);
protected:
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
DECLARE_MESSAGE_MAP()
protected:
void InitFont_();
bool RefreshReaders_();
void FreeResource_();
void SetExitFlag_() { m_bExit = true; }
void InitFrameParam_();
public:
void LogMsg(CString sTxt, bool bDbgOnly = false);
void LogErrorMsg();
};
Maxwell Chen
|
|
|
|
|
I think that this is one of the best ways, the code is also more clear and readable.
Russell
|
|
|
|
|
Moving members also changes how the class is laid out in memory. So if you have a bug in how you access member data, it may be hidden or exposed as you change how the members are arranged in memory.
|
|
|
|
|
Even though there is the topic in MSDN for Side-by-Side and manifest stuffs, I still don't get the correct steps to redistribute a command-line program to another computer.
I use some functions and types of the standard C++ library and some win32 APIs in the program without MFC/ATL. I don't find any project option for statically link to CRT libraries.
The program is to be called by other program, so I don't want to have users run "VCRedist_x86.exe ". I hope to keep it simple!
What would be the simplest way to redistribute this program?
Thanks!
Maxwell Chen
|
|
|
|
|
Maxwell Chen wrote: I don't find any project option for statically link to CRT libraries.
Project properties - C/C++ - Code Generation - Runtime Library = something without DLL.
Maxwell Chen wrote: The program is to be called by other program, so I don't want to have users run "VCRedist_x86.exe".
But users only have to run this once. This would probably been done at installation time.
Or you have to force the users on computers without these files to download and install it once.
Maxwell Chen wrote: What would be the simplest way to redistribute this program?
A Setup.Exe made with the VC-internal setup-functionality or free installers like NSIS[^] or Inno Setup[^].
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
jhwurmbach wrote: Project properties - C/C++ - Code Generation - Runtime Library = something without DLL.
Thank you very much for your great help.
I changed from /MD to /MT, and it works!
jhwurmbach wrote: A Setup.Exe made with the VC-internal setup-functionality or free installers like NSIS[^] or Inno Setup[^].
This program is to be called by an uninstaller to manipulate the registry. So it wouldn't fit for making a setup for this program though.
Maxwell Chen
|
|
|
|
|
Maxwell Chen wrote: This program is to be called by an uninstaller to manipulate the registry. So it wouldn't fit for making a setup for this program though.
But you could add it to the requirements at install time - then it would be there (and not be uninstalled, AFAIK) at uninstall time.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
Hi,
I want to write a C++ program to print a file in user space. But i don't know how to access the printer.
Please help me.
With thanks in advance,
barun
barun
|
|
|
|
|
If you just want to print the file in text format, what about using "stdprn"?
- NS -
|
|
|
|
|
USE system("print filename");
|
|
|
|
|
Hi
Using system is one of the way to handle this, but this method is not generic for other types of devices like scanner or USB stick etc.
We know that any device should be opened then read/write and finally to be closed. Can we write a C++ code to open any device and read/ write into it (e.g. printer) ?
With thanks in advance.
barun
barun
|
|
|
|