16 bit code

Hello,

I have a 16 bit code to maintain. (It is too complex to copile it to 32
bit) so all we are doing is support. Now they want to add a small
feature, where I need to copy long file names in the project. I know we
can not do long file name copies in vc++ (1.52). So I wrote a program
in VC++(6.0) which does directory copy. My questions are
1. How can I call a 32 bit exe (I guess WinExec should work)?
2. How can I make the 16 bit to wait till the 32 bit code completes?
3. Is there any other better way to do this? (other than converting to
32 bit)

Thanks.

0
dbcuser (53)
8/17/2005 9:43:56 PM
vc.mfc 33608 articles. 0 followers. Follow

6 Replies
585 Views

Similar Articles

[PageSpeed] 11

I actually do this in an old 16-bit app that is too expensive to migrate.

WinExec will launch a 32-bit app with no problem.  The produce has been in the field for
seven years doing exactly this.

Getting it to wait is hard, and in fact is not even recommended.  Instead, have the 32-bit
program find the 16-bit app and do a SendMessage to it notifying the 16-bit app of the
termination (this is what I do).  One easy way to do this would simply be to put the
window handle of the window to be notified as part of the command line of the 32-bit app
and let it parse it and use that to provide the HWND for its calling function.  Then just
disable whatever controls/menu items/etc that need to be disabled until you get the
completion notification.
				joe

On 17 Aug 2005 14:43:56 -0700, dbcuser@gmail.com wrote:

>Hello,
>
>I have a 16 bit code to maintain. (It is too complex to copile it to 32
>bit) so all we are doing is support. Now they want to add a small
>feature, where I need to copy long file names in the project. I know we
>can not do long file name copies in vc++ (1.52). So I wrote a program
>in VC++(6.0) which does directory copy. My questions are
>1. How can I call a 32 bit exe (I guess WinExec should work)?
>2. How can I make the 16 bit to wait till the 32 bit code completes?
>3. Is there any other better way to do this? (other than converting to
>32 bit)
>
>Thanks.
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15974)
8/18/2005 2:34:15 AM
Hi Joe,

Thank you very much and it would be great if you help me with code
snippets to do the same. If you don't have time, please don't worry.

Thanks again.

0
dbcuser (53)
8/18/2005 4:26:50 PM
Thanks and I think, I figured it out, using PostMessage, I should able
to communicate back.

0
dbcuser (53)
8/18/2005 9:33:39 PM
Yes.  The problem with code snippets for this particular piece of code is that it is
proprietary, and I'd have to be very careful about what I released.

Note that you can't pass pointers across, and you can't use a 32-bit WPARAM back to the
16-bit app, nor can the 16-bit app send greater than a 16-bit WPARAM (this actually causes
me a fair amount of grief).  However, you *can* send a window handle across in the LPARAM,
and there is some serious magic that handles mapping between 16-bit and 32-bit window
handles; I discovered this by experiment when I first came up with this idea. 
				joe

On 18 Aug 2005 14:33:39 -0700, dbcuser@gmail.com wrote:

>Thanks and I think, I figured it out, using PostMessage, I should able
>to communicate back.
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15974)
8/20/2005 4:31:09 PM
HI Joseph,

Well, I was able to create a shell process which was successfully
called from 16 bit code. Using the dialog model. I was able to pass the
parameters as a config file for 32 bit to take and process. All seems
to be working. I also have the post message in the 32 bit program to
ost message back.
Since this is a dialog based code, how and where to trap the message
coming back to the main program. I am stuck there now. Other than that
everything seems to be working fine now.

Can you help how to trap the message coming back to the main program?

0
dbcuser (53)
8/21/2005 5:08:04 PM
YOu don't "trap" messages.  You simply add handlers to the message table associated with a
particular window class.  So if you pass the handle to your dialog across, it is obvious
that the only message map you have available at that point is the message map for the
dialog itself.  You are confusing "main program" with "window".  They are only vaguely
related.  
					joe

On 21 Aug 2005 10:08:04 -0700, dbcuser@gmail.com wrote:

>HI Joseph,
>
>Well, I was able to create a shell process which was successfully
>called from 16 bit code. Using the dialog model. I was able to pass the
>parameters as a config file for 32 bit to take and process. All seems
>to be working. I also have the post message in the 32 bit program to
>ost message back.
>Since this is a dialog based code, how and where to trap the message
>coming back to the main program. I am stuck there now. Other than that
>everything seems to be working fine now.
>
>Can you help how to trap the message coming back to the main program?
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15974)
8/22/2005 11:28:51 PM
Reply:

Similar Artilces:

Need to permanently changing a row source after running code
Hello! I have added code to a form object's Not In List event to add the item to the row source automatically. While I'm in the form, the item is still there to select, but when I close the form & re-enter, the new items that I just had code add, are not there anymore & it defaults back to my original row source entries. It is not a lookup to another table or query. Just a simple value list. Any help will be extremely appreciated... I'm stumped & desperately need to wrap up this project? Thanks to everyone! Melinda S wrote: > Hello! > I have added code...

SQL Code to set Barcode?
Hello Again, The last SQL code I got (thanks again) worked so well.....the new matrix in 2.0 is interesting; great in many ways, but now the "New Item Wizard" for matrix items does not set barcodes for the individual items, even if it is set on the first screen. Is there a SQL code to set barcodes for all items in our database, both existing and future? Please tell me there is, because otherwise we will be spending a lot of time adding it in..... Thanks, Kat HI Kat, If I am not forgetting last time I given the code for this anyhow again take it may be someone else: This is d...

16 digit numbers
I think Excel can not handle 16 digit numbers bc it sets a limit. Besides changing the number to text, is there a way so I can still us a 16 digit number? For example: I have this number: 1111222233334444. But excel would round it to: 1111222233334440 -- Message posted from http://www.ExcelForum.com Excel can store only 15 digits of precision; anything beyond that is lost. You can store longer numbers as text, but then you lose the ability to do accurate math with them. To have Excel treat the number as text, format the cell as Text prior to entering the data, or prefix the data with an...

Why the image (16*16) is ugly?
Hello, I use the API ExtractIcon to get file icon, then import the ImageList (32bit color), but the 16*16 icons are ugly shown in listview, why? thank you. ////////////////////////////////////////////////////////////////////////////////// Private Declare Function ExtractIcon Lib "shell32.dll" Alias "ExtractIconA" (ByVal hInst As IntPtr, ByVal lpszExeFileName As String, ByVal nIconIndex As Integer) As IntPtr Public Function ExtractIcons(ByVal iconfile As String, ByVal iconindex As Integer) As Icon Try Dim hIcon As IntPtr ...

Rules #16
I want to creat a rule that will move a message with the subject of Hi, but not move if hi is part of another work like BHI. Thanks Hmmm...you might try putting "Hi" in quotes. -- Aloha, -Ben- Ben M. Schorr, OneNote-MVP http://home.hawaii.rr.com/schorr **I apologize but I am unable to respond to direct requests for assistance. Please post questions and replies here in the newsgroup. Mahalo! "Doug Griesbaum" <dgriesbaum@satisfusion.com> wrote in message news:0c0c01c3b9a3$6e96cbd0$a101280a@phx.gbl... > I want to creat a rule that will move a message with t...

Day Validation code
Hello, I am looking for some help for my data entry form. In the form there is a combo box, which is used to enter date ("cboLongDate"). The date format is "Wednesday, June 13, 2007" . I need to confirm the day is Wednesday or not before the user click on add data or close form. The important thing is day (ie "Wednesday") not the date as Wednesday comes every week. If the selected day is not "wednesday" a message box should pop up saying the day selected is incorrect while closing or adding data so that user can get a chance to correct it. Thanks in adv...

Help with code
Hello, I just started an internship, and for my internship i'm making word templates, with some basic VB code. It should work in the following way: employees when opening the file get an wizzard with fields to fill in and the rest is drawn from a database. Everything works fine, except for when i want the output of a wizzard to start on a new line. The code for the wizzard: Selection.Find.ClearFormatting With Selection.Find .Text = _ "uur per week, de werktijden zijn van" .Replacement.Text = "" .Forward = True ...

Change Date By Macro or Code Leaving Only One Record
Hi, I have a table called RUNDATE which has only one record in the date which my whole program looks at as the running date. I would like to run a Macro on a form or a Code upon which once I press it that single date in that table to change to the next day, lets say from 3/5/07 to 4/5/07 to delete the previous record of the 3/5/07 and to be left only with one record with the new date in this case lets say 4/5/07. Much Appreciated make a query of this single record table field - and then put that query into your form as a subform.....you can keep it not visible if you wish......

REASON CODE
How can I get reason code reports on NO SALE, DROP AND PAID OUT Hi Gill, I gave it a fair crack but couldn't figure it out either. If no one else is able to help you you might conclude that RMS cannot do it and might need to write a crystal report. Otherwise, I'm stumped, sorry. "Gill" wrote: > How can I get reason code reports on NO SALE, DROP AND PAID OUT > ...

publisher #16
cannot open saved files from either publisher or word. from documents file. i.e. cannot retrieve saved files note says file not available anthony wrote: > cannot open saved files from either publisher or word. > from documents file. i.e. cannot retrieve saved files > note says file not available Not enough information, but it sounds to me as though you are trying to save/open from a network location which Publisher abhors - Publisher files /must/ be saved to a local drive. If that's not the case, then please post back with more information - where are the files being s...

Incorrect behavior by Windows Explorer: error code 0xC00D0BB8 setting title on mp3 file.
I have an mp3 file. I right click, "Properties", and click Title, then paste: Libert´┐Ż and hit enter. Then I OK the dialog. Exploder makes the following incorrect response: An unexpected error is preventing this operation. Make note of this error code, which might be useful if you get additional help to resolve this problem: Error 0xC00D0BB8 No error description available There are actually THREE things incorrect here. 1. Instead of obeying me unquestioningly, the computer refused and talked back to me, even though there was no error whatsoever o...

Using 64 bits software for read data of acces
This is a multi-part message in MIME format. ------=_NextPart_000_001B_01C73FE2.6964A1F0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, I have to write one 64 bit software that read data on an data base = microsoft acces. It seem that 64 bit drivers isn't availlable. When do you have it? thank ------=_NextPart_000_001B_01C73FE2.6964A1F0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML>&l...

Font color in the cells 03-16-10
Hi, How about the way to change the color within VBA? Bst Rgds, HuaMin Range("A1:A10").Font.ColorIndex = 3 -- Jacob "HuaMin" wrote: > Hi, > How about the way to change the color within VBA? > > Bst Rgds, > HuaMin Many thanks. I've tried the values 3, 4 for the index. But I don't see any difference in the cell. How do we know which index is for which color? "Jacob Skaria" wrote: > Range("A1:A10").Font.ColorIndex = 3 > > -- > Jacob > > > "HuaMin" wrote: &g...

how to put in sql code
first of all many thanks to Klatuu who has already helped me a lot!! I create my SQl code by means of some string concatenation. I do this so i can use the values of my field to create my SQl code. The problem is that some of these fields are double-populated eg. field location contains England and Brazil. My string creates "IIf([Table]![Location]" & [Location] & ",'OK', 'problem')" how can i populated the field location so that it is SQl-code? as =(Brazil or England) does not work as =Brazil or = England do...

how to format zip codes
how do you format zip codes with a dash and additional numbers so you can merge them to a word document for example(23838-1101) If you are using the Excel Zip Code Format and Word 2002 or later, you have a couple of options. In Word, go to Tools | Ootions | General and make sure Confirm conversion at open is checked. Then, when you start the merge, choose MS Excel Spredsheet via DDE (the wording will be slightly different depending on your Office version--look for spreadsheets and DDE). Option 2 would be to format your zipcodes as text in Excel. This would mean you'd have to ...

Distribution Lists #16
Is it possible to send the same message to a group of people, but as seperate messages and not a distribution list. The reason being is that I have a group which has 100 members. When I send a message to the group, the message gets caught by spam filters for having too many names. That would require a mail merge to electronic mail. -- Russ Valentine [MVP-Outlook] "T Dyer" <T Dyer@discussions.microsoft.com> wrote in message news:D0D9B761-197F-4B34-A112-E374377ADEAC@microsoft.com... > Is it possible to send the same message to a group of people, but as seperate messages and...

SetIcon 16 x 16 vs 32 x 32?
Hi, By default, a MFC app contains in OnInitDialog(): SetIcon(m_hIcon, false); SetIcon(m_hIcon, true); But Windows XP is using the 32 x 32 icon (resized) for the title bar, instead of the 16 x 16 icon. Why? When I removed the line with false, it worked as expected and the 32 x 32 icon is still used in the 'alt-tab' window. ...

if Statement code
Greeting, I have a report which shows Students marks, in this report there is 5 fields for Subjects and one for Total. There is one more unbound text box for showing the progress. What I need to do is if the total text has grade <=39.9 than unbound text value = failed and with red color. If total between 40 and 49.9 than the good, if total between 50 and 59.9 than very good, if total between 60 and 70 than excellent else out standing How can I do that?? Thank you On Sat, 16 Feb 2008 06:06:00 -0800, ghost wrote: > Greeting, > I have a report which shows Students marks, in this...

What's the difference between 64 bit and 32 bit
What's the difference between 64 bit and 32 bit when downloading a virus patch? Second, download the MS03-026 security patch from Microsoft: Windows XP (32 bit) http://download.microsoft.com/download/9/8/b/98bcfad8-afbc- 458f-aaee-b7a52a983f01/WindowsXP-KB823980-x86-ENU.exe Windows XP (64 bit) http://download.microsoft.com/download/a/7/5/a75b3c8f-5df0- 451b-b526-cfc7c5c67df5/WindowsXP-KB823980-ia64-ENU.exe This is a multi-part message in MIME format. ------=_NextPart_000_0016_01C361A3.85DC80D0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encodin...

Facility for using COST CENTER codes while entering transactions
Hi, To minimise the number of account codes and to analyse my expenses for individual departments , I would like to allot CC for all the Depts. / Activities and use them while entering transactions in the system. Is it possible to do in MS GP ? Is anybody using such a feature now ? Raj Yep, either MDA or Analytical Accounting will do this for you. Mike "INTERNAL AUDITOR" <INTERNALAUDITOR@discussions.microsoft.com> wrote in message news:05471113-51D1-450F-9A30-93B82434CBBC@microsoft.com... > Hi, > > To minimise the number of account codes and to analyse my expe...

Set up account 12-16-09
I need help setting up my account, please i need help to, i cant send emails "Crystal Hopper" <chopper81@microsoft.com> wrote in message news:ufrDMZjfKHA.5608@TK2MSFTNGP05.phx.gbl... >I need help setting up my account, please "Crystal Hopper" <chopper81@microsoft.com> wrote in message news:ufrDMZjfKHA.5608@TK2MSFTNGP05.phx.gbl... >I need help setting up my account, please Your email account provider has that information. They should have a help page on their website. If you tell us who provides your email account, perhaps someone ca...

Macro Code ... Next Sheet
I have many many files where I want to change the name of the Tab Sheets from whatever they are now to a new name ... simply "Page 1", "Page 2", "Page 3" etc ... I would like to do this with a Macro ... but need code ... Select 1st sheet regardless of name ... rename to "Page 1" Select 2nd sheet regardless of name ... rename to "Page 2" Select 3rd sheet regardless of name ... rename to "Page 3" The number of tab sheets vary so I assume Macro will simply abend when it reaches the end ... Unless of course you highly respected Wiz...

Numpad Enter vs. Keyboad Enter, different virtual key codes?
I'm working with a 3rd party program that takes hotkeys for data entry into the program. I've created a little program to help with tedious inputs, however have come across a stumbling block. All data inputed into the program is culminated by hitting the Enter key on the Numpad... if you hit the Enter key on the keyboard, it doesn't operate as a hotkey. This is perplexing to me, as I've never seen a reference to a virtual key code distinguishing the two Enter keys. Using the regular VK_RETURN does not work. Does anyone have any ideas on this issue, or how I might be able to get...

VBA code question?
Hi everyone, I have this simple 3 subs vba code. It runs 8 times and each solution has 24 values that is put in one column of 24 raws. So, the 1st solution found gets written at N2 to N25....and so on. The problem I have is this: The 1st solution that gets written from N2-N25, later it gets removed; just the 1st solution! What could be causing this in the code? Thanks in advance. Option Explicit Option Base 1 Sub Pareto() Dim cell As Range, ModelCounter As Integer, JobNr As Integer Dim ret As Integer Dim ARngSolution As Range Application.ScreenUpdating = False ModelCou...

getting current file size with vba code
Hi all, is it possible to get the file size with the vba code? hi, thread wrote: > is it possible to get the file size with the vba code? Function FileLen(PathName As String) As Long Element of VBA.FileSystem mfG --> stefan <-- ...