|
Hi kuphryn
Where this code should be written i mean in Initdialog or in PreCreate window ??
Thanx
TAKE CARE
|
|
|
|
|
Put in it stdafx.h. Call it whenever you want to change the default button.
Kuphryn
|
|
|
|
|
I'm not sure, but I think SetDefID(IDCANCEL) would work.
|
|
|
|
|
sorry friend Philnessosity
this doesnt Work !!!!
Thanx
TAKE CARE
|
|
|
|
|
Does anyone have source code that you can give me, or a link to a site, for creating/filtering/manipulating shape files? That is, the file set made up of .shp, .shx, and .dbf files?
It doesn't really look too hard, but I don't want to have to start from scratch.
Thanks,
Dave
"You can say that again." -- Dept. of Redundancy Dept.
|
|
|
|
|
I think ArcObjects will do it - but for a price
|
|
|
|
|
I am printing a graphic on a printer DC. I am using the same drawing library for the screen and for the printer output. If I do the printing I have to scale the DC with SetViewportExt to get a proper output on the paper.
But if I scale the printer DC I get a completly ugly output of the graphic on the printer if the ICM (Image Color Matching) option is set in the printer dialog! If I disable ICM in the dialog or using the SetICMMode(hDC, ICM_OFF) the output is correct.
Has anyone an idea why ICM doesn't work correctly if I scale the printer DC?
Thanks in advance.
|
|
|
|
|
I am writing this application for a pocketpc, but I would assume that the basics of the CScrollView class would not differ to much. Here is what I would like to be able to do:
Is it possible to set the size of the view port smaller than the size of the screen and still have a portion of the screen scroll when text rolls off the screen?
What I need is I have some title printed at the top of a View that need to stay static. When text goes beyond the bottom of the screen I want the vertical scroll bars to appear so the user can scroll up and down to view the data, but still have the title's remain visible. Sort of like a frozen row in Excel.
Currently the only work around that I have found is to repaint the entire screen on each up/down click no the scroll bar. This results in screen flicker and is extremley inefficient. Also, using this method does not allow the user to click and drag the scroll bar to a position as the application attempts to redraw the entire screen with each increment.
Thanks,
-Eric
|
|
|
|
|
Adjust the size of the non-client area of the window (in OnNcCreate() ) and paint the title in the non-client area.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Ryan,
Thanks for the help. I don't see an OnNcCreate() in the ppc framework. I thought it would be part of the CWd class but I don't see it defined. I tried altering the CREATESTRUCT in the PreCreateWindow and setting the cy attribute to 300 since the screen is 240 x 320. This I was hoping would give me 20 pixels to work with at the top of the screen.
When you say adjust the non-client area are these actual members of the CWD class?
Thanks again for the help,
-Eric
|
|
|
|
|
I need to get a Modal-Dialog's handle (HWND) before I enter the blocking DoModal() call.
The thing is the Dialog is only created inside DoModal().
Is there a way to create it in some way and then call DoModal() seperately ?
|
|
|
|
|
|
I need to call DoModal(), I need a Modal dialog that blocks everything else.
I just need to create it before entering the modal loop.
|
|
|
|
|
ohadp wrote:
I need to get a Modal-Dialog's handle (HWND) before I enter the blocking DoModal() call
Why??
Put your code inside OnInitDialog() or OnCreate() in your dialog.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
if you r planning to intialize any variable then you can just write some function in the dialog class and call these just by creating the Object of the class and calling the function before calling domodal
Thanx
TAKE CARE
|
|
|
|
|
This specific dialog doesn't need to knwo to do special stuff in it's OnInitDialog().
What I did eventually was send it a pointer to :
class CRunner
{
public:
virtual void Run() = 0;
};
but I'm still looking for a better way, as in externaly creating the dialog, accessing it's HWND, then entering the Modal-Loop.
Does someone have an example of creating the dialog Modeless, and then entering some sort of message-pumping loop that would make it modal ?
thanks
|
|
|
|
|
I don't have the exact code, but you can do something like this:
CMyDlg dlg = this;
dlg.Create(dlg.IDD);
HWND hWnd = dlg.m_hWnd
EnableWindow(FALSE);
dlg.CenterWindow();
dlg.ShowWindow(SW_SHOW);
int nResult = dlg.RunModalLoop(MLF_SHOWONIDLE);
dlg.DestroyWindow();
EnableWindow(TRUE);
You can also check out MFC's code for DoModal.
Regards,
Alvaro
Hey! It compiles! Ship it.
|
|
|
|
|
Usually for this is used following method:
_CrtDumpMemoryLeaks();
From here:
http://msdn.microsoft.com/library/d...akdetection.asp
#define CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
# other includes
Note The #include statements must be in the order shown here. If you change the order, the functions you will use may not work properly.
_CrtDumpMemoryLeaks();
I call at destructor of COM class.
Which is generated with standard COM attributes,
All Debug information is (probably) generated.
But this is not generates string numbers of leaks...
Why so?
Thanks.
__________ my stdafx.h
#define _CRTDBG_MAP_ALLOC
#include <atlbase.h>
#include <atlcom.h>
#include <atlctl.h>
#include <stdlib.h>
#include <crtdbg.h>
Outputs only "_CRT_NEW" leak strings locations...
Not useful...
|
|
|
|
|
hello im a kinda newby c++ programmer,im currently writing a socket client\server application under the windows platform.
i have established a connection between my client server app and also made my client send data,i know the client is sending corectly coz i tested it with netcat,however the server wont recive any of the text data that i am sending from the client. my problemb is with the recv(); i have seen working code that recives data in a console app but i just cant incorporate it into my mfc server.
it must only be a little mistake i am making but its really bugging me,any help or info regarding the recv function from a mfc point of view would be much appriciated
thanks 4 your time
chris
thes3cr3t1@yahoo.com
|
|
|
|
|
I don't understand your problem. What is your trouble with recv? Don't you receive data?
Do you send text data or binary data? Maybe you can provide the piece of code where you use recv.
|
|
|
|
|
int nBytes;
CString buffer;
nBytes = recv(Socket,buffer, sizeof(buffer), 0);
// check for errors
if (nBytes == SOCKET_ERROR) {
m_strStatus = "Recv Failed";
UpdateData(false);
}
else
{
// print the received message
m_strStatus = "Message Received";
m_strMessage = buffer;
UpdateData(false);
}
there is my code for the recv function,at the moment it wont compile,its complaining that it cant convert from class CString to char*.
im tryning to send text to the server,the text should be displayed in my editbox varible named m_strMessage.sometimes i do get some text in there but it isnt from the client i only assume its some sort of error code.
i have tried all sorts tryna get this to work for you it might pretty simple however im just a newby.
thank you for your time m8!
|
|
|
|
|
You have to wait until you receive data.
while(y=recv(conn,(char*)&mlMsgRecv, sizeof(mlMsgRecv),0))
{
...
}
Have a look at the following article which is a very good tutorial for the first socket steps:
http://www.codeproject.com/internet/winsockintro01.asp
|
|
|
|
|
thank you, mucha appriciated!;)
|
|
|
|
|
Hi !
My application has several instances of different objects. Some of these have to be persistant and have to be stored in a relationnal database.
I guess it would be better that my persistant objects don't know about the database, but I don't know how I should implement that. Should I have a global class knowing every persistant objects and being able to store, retrieve, delete any objet in the database ? Or should I rather have one object knowing the database for each type of persistant object ?
I would appreciate to get some hints or suggestions from you !
Thanks !
Jerome
|
|
|
|
|
If your objects are derived from MFC's CObject, why not just create a CMemFile, Archive the object to the memfile, and store the resulting buffer into an image/blob column in the database?
onwards and upwards...
|
|
|
|