|
...must be more tired than I thought when I didnt see the obvious
|
|
|
|
|
I posted this on another forum but I am hoping this forum will have some good suggestions.
I am trying to incorporate functionality into an application so that the user can hit the Minimize button on a window and the window will minimize to a particular size. I am trying to do this with the Minimize, Maximize, and Close buttons on the top right of the window (standard window functions). My problem is I am not sure how to do it. If the user resizes the window, I am preventing the window from going below a specific size. But is there any way to do the same thing when the minimize button is hit or I am forced to allow the window to be fully minimized?
This is not C++ or MFC, I am having to do this in an application that is written in C. Any suggestions?
|
|
|
|
|
Handle the WM_SYSCOMMAND message.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Has anyone figured out how to create a CFileDialog and
set its sort settings? I have read the numerous examples for
setting the filters, but can find no information of column sorting.
For example I want to bring up a CFileDialog
and show the files sorted by date.
What I would really like to do is get the settings that the user
last used and bring up the CFileDialog the same way the next time my application
creates one.
Thanks in advance to the most useful people on the WWW
|
|
|
|
|
MaxHacker wrote:
For example I want to bring up a CFileDialog
and show the files sorted by date.
So just click on the Modified column. Nothing special is needed.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Yes OK, but what I am REALLY looking for is a way for my application
to read from the CFileDialog what the user has sorted on, and pre sort it the next
time I display one so that the user does not have to do it each time.
|
|
|
|
|
You might try setting the value of m_ofn.lpfnHook and see if you get notified of a heading click.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
I have interfaces definitions.
I have implemented them in dll's
These dll's worked as cutom plugins. Usually they were build by msvc.
Each dll exported 3 function, GetIterfacesCLSIDS()/Create(CLSID)/Destroy(CLSID). It woked superb when both (client, plug in were buld by msvc compiler)
or both with mingw compiler.
The client now has growned and I'm using massive MFC (has lot's of gui and u knw is easy).
Now I try to build the dll's on demand (as compiled script)
and I use free gcc (g++) from (Mingw) C++ compiler and dlltool.
The dll is oj, and exported functions are called and my instances created ok.
Now I get 'ESP was not saved corectly durring a ... see the call type'
So is not the call type. As long the object imlementor of the interface is created my dll and the virtual table layout is different than the msvc.
Msvc vtable is
PObject->PVtable->[Vf1][Vf2]..[Vfk]
while
mingw vtable is
PObject->[Vf1][Vf2]..[Vfk]
So there is a missing intermdiare [PVtable] pointer there. Does any one know how to hack the calls using trunks or __asm (back and forward)
these ? Thanks
|
|
|
|
|
|
Sorry guyz...I ask another question to you.
Ok, I began studying some MFC programming with Jeff Prosise's "Programming Windows with MFC 2nd Ed." and I am blocked at the Hello World chapter.
I use his code:
HELLO.H
class CMyApp : public CWinApp
{
public:
virtual BOOL InitInstance ();
};
class CMainWindow : public CFrameWnd
{
public:
CMainWindow ();
protected:
afx_msg void OnPaint ();
DECLARE_MESSAGE_MAP ()
};
HELLO.CPP
#include <afxwin.h>
#include "Hello.h"
CMyApp myApp;
/////////////////////////////////////////////////////////////////////////
// CMyApp member functions
BOOL CMyApp::InitInstance ()
{
m_pMainWnd = new CMainWindow;
m_pMainWnd->ShowWindow (m_nCmdShow);
m_pMainWnd->UpdateWindow ();
return TRUE;
}
/////////////////////////////////////////////////////////////////////////
// CMainWindow message map and member functions
BEGIN_MESSAGE_MAP (CMainWindow, CFrameWnd)
ON_WM_PAINT ()
END_MESSAGE_MAP ()
CMainWindow::CMainWindow ()
{
Create (NULL, _T ("The Hello Application"));
}
void CMainWindow::OnPaint ()
{
CPaintDC dc (this);
CRect rect;
GetClientRect (&rect);
dc.DrawText (_T ("Hello, MFC"), -1, &rect,
DT_SINGLELINE ¦ DT_CENTER ¦ DT_VCENTER);
}
Now what I do? Simply, I create a new Win32 app, empty project and I create the two files; when I run the application I get two errors...
Compiling...
prova.cpp
Linking...
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
Debug/prova.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
prova.exe - 3 error(s), 0 warning(s)
HELP ME! PLEASE!
Thanx boys!
Alberto from Italy.
|
|
|
|
|
Solution is simple:
In project properties select --> c++ --> code generation,
then in Run time library select Multi thread debug.
Cheers,
|
|
|
|
|
|
I have grown accustomed to use CObArrays in my applications, and I often have quite a few. For serialization I find them particularly easy to use.
But one thing worries me, it is as far as I can see not possible to use functions like reserve() and capacity() that the STL vector class have. In MSDN it is recommended to use SetSize(), but I have no idea at compile time how many items there will be in the arrays.
Does this mean that the pointer array is copied every time an Add() is carried out? That will result in memory looking very much like Swiss cheese at the end. MSDN speaks of default block size, but I can not find out what that is. Don't know how big this problem is in practice.
Regards, Haakon S.
A sure cure for seasickness is to sit under a tree.
Spike Milligan
|
|
|
|
|
Haakon S. wrote:
But one thing worries me, it is as far as I can see not possible to use functions like reserve() and capacity() that the STL vector class have.
That would be because the MFC container classes are crap.
Haakon S. wrote:
Does this mean that the pointer array is copied every time an Add() is carried out?
Dunno, I shun the MFC containers. But I do know that all the MFC source code is on your hard drive, it's installed with VC. So it should be easy to find out.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
I was looking at some sites that gets your IP and gives you your geographic location. I am wondering how do they do that? Anyone has any idea?.
Look at this site as an example: http://www.geobytes.com/IpLocator.htm?GetLocation
Danke,
|
|
|
|
|
Short answer: Databases. Big honkin' databases of location information for different hosts and networks.
There's also the little-used LOC field on DNS entries.
You can download an old (circa 1998) database (in text format) here:
http://www.dtek.chalmers.se/~d3august/xt/dl/[^]
It's the "ndg_files.tar.gz" archive, provided by the Xtraceroute[^] author.
- Mike
|
|
|
|
|
Yep, as a previous post had mentioned, it uses a big database with the information in it, and performs queries looking for the IP address.
The product that GeoBytes offers that does this is called GeoNetMap. It's $49 for a developers license so you can get some code down and so on for your own website. Then they charge different commercial prices depending on the number of queries per day. (For instance 10,000 queries a day cost $500 a year).
I've looked at the code for it and it is very simple code to incorporate it for your own website if you are interested. ASP, PHP, PERL (and I think Java) are some of the languages that they provide examples for.
|
|
|
|
|
I have some software that communicates over a serial port. It opens the serial port with the usual ::CreateFile() call and works fine in the following circumstances:
1) The computer has a real serial port that I am opening
2) The computer has a real serial port, but the serial port I'm opening is one hanging off a serial-to-USB or -to-PCMCIA converter
What does NOT work SOMETIMES is the exact same code running on a computer that does not have a real serial port, where I am trying to open a serial port on a serial-to-USB or -to-PCMCIA converter. When the open fails, it tells me that it could not create the file.
What could cause the failure? It seems to have to do only with whether the computer has a real serial port, not with whether the serial port I'm opening is a real one or one hanging off a converter.
Thanks
|
|
|
|
|
I have found the answer already, so no need to reply. If anyone is interested, the answer is that the "fake" serial ports must be opened by calling ::CreateFile() with a string like "\\.\COM5", instead of just "COM5". The latter will work if the computer has a native serial port, but won't if it doesn't.
|
|
|
|
|
Hi.
I want to sending information from DOS(Real Mode) to windows app.
I don't want to use shared folders. i want my app in dos(Real Mode) sending information to another app that i was wrote in windows.
this is very important to me.
Thanks.
|
|
|
|
|
hmmmm, ur message doesnt make sense...
when u run a DOS app in windows, it doesn't run in real mode, it is just emulated.
i've never heard about a DOS<->windows communication... i would use a shared folder, cause all the other synchronisations like named pipe, event, mutex etc are not accessable from a dos app.
u could try to check network, i don't know if this could work!
good luck,
Alexander M.
Don't try it, just do it!
|
|
|
|
|
In windows 98, at the A: you can type c:\win to fire up windows.
What is the command for Windows 2000 ???? (from the A: prompt)
Any help appreciated
George W
Software Developer
www.zsystems.ca
|
|
|
|
|
Hello,
It does not possible boot from dos command prompt like windows 98.
With Regards,
R.Selvam
|
|
|
|
|
Hi all guys!
I'm programming Windows with Visual C++ (6.0) for my first time; i created an applicatio, with a simple menu and an ABOUT BOX dialog; well, now the problem is that I want to add also an icon. So I go to Insert -> Resource -> Icon and I drive my one. Then in the code I use:
wndclass.hIcon = LoadIcon (NULL, MAKEINTRESOURCE(IDI_ICON1)) ;
Ok then. I start my app...but I see a normal Win icon not mine!
What's the problem?
Alberto
|
|
|
|
|
The easiest way to do this is to remove the icon that AppWizard created for you, copy the desired icon to the Res folder, and rename it to what the original one was, recompile.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|