|
makom42 wrote:
removing all of my new operators
Weeeellll...
You could overload the operator new() , but this would the be a little over the top I think.
|
|
|
|
|
|
|
As I understand it, heaps in WIN32 are particular to the process.
There is no global heap across applications for data (such as
there was in Windows 3.1), nor heaps specific to code sections.
There is only the one default heap and any dynamic heaps created
with HeapCreate. If your application calls a function in a loaded
DLL that creates a heap, it belongs to the process. (it will
show up in the handles returned by GetProcessHeaps)
If the DLL function allocates memory using, for instance, GlobalAlloc
or LocalAlloc (same thing in WIN32), it is allocated on the process's
default heap and may be used or freed anywhere in that process.
So I think the exception you mentioned is not thrown because of the
section of code in which it was allocated, but some other reason--
maybe it was freed elsewhere. Maybe the handle or pointer was changed
on you and you are accessing an invalid address.
Short: what you are trying to do is perfectly ok. It's just got a bug
someplace.
|
|
|
|
|
Daft as this may sound, I hope this is the case...
|
|
|
|
|
No idea why this replied as anonymous - seeing as I have logged in... but there you go...
makom42...
|
|
|
|
|
Hello,
I'm trying to resize my Property sheets, and I've almost done it, but I still have one little problem, when I resize the TabCtrl I must be able to know how many lines of tabs will it occupy after the resizing action.
Is there any way to know this?
NOTE:
If after the resizing action the TabCtrl has more than one line of tabs, then I can't see the tabs properly, but when I change of tab (pressing Ctrl + tab or with the mouse) the tab control gets resized in the right way.
Tahnk you in advance.
|
|
|
|
|
You should be able to use CTabCtrl::GetRowCount() to get the number of rows in that the tab ctrl is using, and then use CTabCtrl::GetItemRect() to get the height of a particular tab. Using these values, you should be able to calculate the overall tabctrl's height (and width).
Chris
"No one goes to hell because of their sin, but because of rejecting God's method of salvation: His Son's life for yours..."
"It does not take a majority to prevail ... but rather an irate, tireless minority, keen on setting brushfires of freedom in the minds of men." --Samuel Adams
|
|
|
|
|
Hi,
I have a small query.
I want to attach another dialog to the bottom of the a dialog.I shouldn't be able to move the bottom dialog.It should look like there is only one dialog.Also if i resize the bottom dialog top dialog should also be resized.
How can i achieve this?
Regards
Neha
|
|
|
|
|
If you can't move it, why do you want two dialogs ? You could handle WM_MOVE in one and move the other, and make the bottom one frameless, but it will always be a hack. If you explain why you want to do this, perhaps I can give better advice.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Why i needed 2 dialog boxes was my application is a custom dialog app.I need to paint Non-client area(border,caption etc..).
||------------|| ------>CAPTION
||------------|| -----> PART 1
|| ||
|| ||
----------------
|| ||
|| || ------> PART 2
||------------||
Bitmaps disaplyed as a border for part 1 & 2 are different.So i thought of using diff dialog boxes.
Any idea,how can i achieve this?
Regards
Neha
|
|
|
|
|
I would have thought if you're drawing them yourself you can just draw the two different parts ? It would be a lot simpler.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
You can do that easily with property pages
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
Could you please tell me how?
Thanks
Neha
|
|
|
|
|
It's pretty straightforward. Create a new dialog as a property page type, give it a class (as you would with any normal dialog)
then in the main dialog, do something like this
m_pxSubDialog = new CSubDialog( this );
m_pxSubDialog->SetAnyOptionsEtc();
m_pxSubDialog->Create( IDD_DIALOG_RESOURCE_NAME, this );
m_pxSubDialog->SetWindowPos( ... );
m_pxSubDialog->ShowWindow( SW_SHOW );
(where m_pxSubDialog is a member of the main dialog class, of the type of your new sub dialog, and IDD_DIALOG_RESOURCE_NAME is the name of the dialog in the resource editor.)
To close the sub dialog from the main dialog, use
m_pxSubDialog->DestroyWindow();
delete m_pxSubDialog;
m_pxSubDialog = NULL;
To make your sub dialog communicate with the main one, you can pass messages back from the child to the parent window
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
Thanks for the reply.
Still i didn't understand this line:
Create a new dialog as a property page type
Could you please explain me that?
|
|
|
|
|
Ok, select the resourceview tab in the your project's workspace, rightclick inside the dialog folder, and select "Insert...". A window of options will appear. Open up the "Dialog" group and select one of the IDD_OLE_PROPPAGE_xxx options (there's no difference between the LARGE and SMALL options bar the size that it starts the dialog in the editor, so it doesn't matter)
You'll now have a borderless dialog which you can design as you would any other dialog. When you use the code I gave, it'll insert that dialog inside the window of your main dialog (and becomes part of the main dialog as far as a user is concerned)
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
Hello,
Problem description:
Send information from the program using the default mail client.
Browsing through MSDN, one possible way seems to be using the CSMTPConnection and CMimeMessage Classes from the ATL Server library.
Is there an alternate method?
I have tried similar stuff in VB. The code for the same is attached. However it limits the mail client to Outlook.
*********************************************
Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItem(olMailItem)
Set myAttachments = myItem.Attachments
myAttachments.Add "C:\Hello.txt", olByValue, 1, "Hello World"
Set myRecipient = myItem.Recipients.Add("rainadeepti@rediffmail.com")
'save the item before sending it off.
myItem.Save
myItem.Display
*********************************************
Thanks in advance.
Regards,
Deepti
|
|
|
|
|
From memory you can use ShellExecute (or CreateProcess ), passing "mailto: email@address" as the process name. Look these up on MSDN to find out the exact format. This basically creates a new mail message using the default mail client. You can add attachments etc. using other command line parameters, the only thing you can't do (i don't think) is send it automatically (the user has to click "send").
-Alex
|
|
|
|
|
Thanks Alex.
Using ShellExecute, I am able to open the default mail client but my main problem is to attach a file to the mail message. Could you provide me a sample for that.
Regards,
Deepti.
|
|
|
|
|
::ShellExecute(NULL, NULL, "mailto: email@address.com \"C:\\scandisk.log\"", NULL, NULL, SW_SHOW);
You can also set things like the subject (&subject=) and (&body=) in the same string that you set the mailto: and file. Exactly how you format it i'm not sure but if you play around with it you should be able to do just about everything except for automatically send it. For that you need to use MAPI or automate Outlook.
-Alex
|
|
|
|
|
Thanks alex.
I had the syntax for adding the subject and body of the mail.
Its written as..
ShellExecute(NULL,"open","mailto:dr@dr.com?subject=Registration&body=Registration code is alpha",NULL, NULL, SW_NORMAL );
subject and body are keywords defined in teh MSDN help for mailto.
However guess the documenters missed out on attachements.
Thanks for clarifications.
Regards,
Deepti.
|
|
|
|
|
Hi,everyone!
Look at the following statements,
--------
sockaddr_in.sin_addr.saddr = htonl(NULL);
sockaddr_in.sin_port = htons(0);
--------
What means NULL ip address and port 0?
Cheers,
George
|
|
|
|
|
both the same NULL is #define'd' to:
#define NULL 0
|
|
|
|
|
Thanks, Almond pal!
You helped me a lot.
Cheers,
George
|
|
|
|