DoDataExchange VC++ 6.0 - visual-c++

I inherited an very old application that I am in the process of updating it (I know, we should have rewrote it in VS 2008, but we purchased a company, which is how I was stuck with the relic). Using UpdateData(TRUE) to retrieve the changes made in the dialog controls, nothing is being updated. I have an edit control, with an integer variable, and an edit control with a string variable, assigned using the class wizard. Upon pressing the OK button, the UpdateData(TRUE) is executed to retrieve the new values from the disalog.
I seem to remember having a similar problem back when VS C++ 6.0 first came out, but have not used it since VS 2003 and C# became prevalent.
Thanks for any help in advance!
Bill

Check the DoDataExchange() method. It should have the logic for writing data to or reading it from the controls. If the programmers used the default implementastion, then there will be a DDX_... macro for each control that is being read/written. Just look at any other MFC dialogs (in your code or google) to see how the DDX commands should be written if they are missing.
Alternatively, if it's only 1 or 2 values you can easily just get the control and read it directly if you don't mind doing validation etc yourself. Get the ID of the control from the form designer and use something along the lines of:
CEditWnd *pWnd = GetDlgItem(ID_THECONTROL);
CString newValue = pWnd->GetWindowText();
...

You'll need to look at the content of the DoDataExchange method and see what it is doing. There is not sufficient information here to tell what could be going wrong other than that.

Related

Xpages: is it possible to allow user to select multiple values and display dynamic result depends on user’s selection in Domino Designer 9.0.1?

I would like to ask is it possible to allow user to select multiple values and display dynamic result depends on user’s selection in Domino Designer 9.0.1?
We are required to develop a web application using xpages.
Here is is the background of web application:
Each member has a current group
Each group are required to join some specific activities
Member can choose future group and check the activity is joined or not join
That means use member in current group’s latest activity status (joined or not join) to compare the future group (find which activity is joined or not join)
The sample pictures about the application will be like the following
For user's selection: the user can choose multiple members with related current group and the user can choose the future group for each member for the comparison.
After click the Submit button, the result shows to the user
Here is the question: is it possible to do this in Domino Designer 9.0.1?
The reason we ask is we haven't find similar sample on the internet yet and we don't know whether it is possible to do in the Domino Designer 9.0.1.
Grateful if someone can provide advice on this issue please. Thank you very much.
Update:
We apologize for our misleading question. We are absolutely not asking someone to write code for us.
We are not able to upgrade to Domino 9 at the moment and we are currently writing some code using 8.5.2.
However we have a concern that if we write a lot of complex code in the application, it will be a trouble for our colleagues to do the maintenance for program.
Also assume we write a lot of complex code in the application and the program works, what about if the user has new requirements base on the current function for the program? We believe the code will be much complex and hard for someone who handle this task to understand the logic of the program.
Thus, for the future development and the program maintenance. Is the latest version more flexible to develop and maintain or just not much difference to accomplish.
Sorry for the inconvenience we have made.
Thank you for your time.
Update 2
For the coding of the program, we have the following experiment.
Option Public
Option Declare
Sub Initialize
Print |Content-Type:application/text/html|
Print "<tr><td>Result<br></td></tr>"
Print "<br>"
Print "<br>"
Print "<table border = 1><tr><th>Member</th><th>Test 001</th><th>Test 002</th><th>Test 003</th></tr></table>"
Print "<table border = 1><tr><th>Activity</th><th>Joined</th><th>Joined</th><th>Joined</th></tr>"
Print "<tr><td>Activity 1</td><td>No</td><td>Yes</td><td>No</td></tr>"
Print"<tr><td>Activity 2</td><td>No</td><td>Yes</td><td>No</td></tr>"
Print "<tr><td>Activity 3</td><td>Yes</td><td>No</td><td>No</td></tr>"
Print "<tr><td>Activity 4</td><td>No</td><td>No</td><td>Yes</td></tr>"
Print "<tr><td>Activity 5</td><td>Yes</td><td>No</td><td>No</td></tr>"
Print "<tr><td>Activity 6</td><td>No</td><td>No</td><td>Yes</td></tr></table>"
End Sub
Those code just hard code only, it will open in html format.
Due to the data will change depends on user's selection, we cannot guarantee the size of the table and hard to define data to locate in which cell.
We are currently studying how to make those code dynamically, make it more flexible.
Thank you.
The tool you need in XPages are custom objects either in JavaScript or Java (that's way less scary than it sounds) and one repeat control for the rows. If the number of columns are dynamic too, then you need 2 repeat controls.
The layout reminds me a lot of the table walker example (I wrote) as part of IBM's original XPages 8.5.0 training exercises. You need to check them out.
In particular look at Exercise 23. The data source, multi value fields might not fit your case, but the dynamic table does.
Good luck and let us know how it goes.

Alternate InstallShield SetupCompleteSuccess Dialog

I was wondering if it's possible to alternate the SetupCompleteSuccess dialog for InstallShield based on certain conditions. As hyperlinks on dialogs only work with MSI version 5.00 and above, I have the following conditions set on SetupCompleteSuccess and SetupCompleteSuccessWithLink
VersionMsi >= "5.00"
and
VersionMsi < "5.00"
The problem I'm facing is that SetupCompleteSuccess appears to have a special sequence order of -1 so I'm stuck.
Thanks
Unfortunately Windows Installer doesn't make this trivial with how their hyperlink control works. This interaction in particular is a bad one.
Here's one approach I suspect would work, but haven't had a chance to try out. In sequence -1, instead of putting the name of a Dialog, put the name of a custom action that chooses between your two alternatives, and invokes the selected one with MsiDoAction or equivalent.
You could use a custom action to emit temporary data into the InstallUISequence table to redirect which dialog is -1 based on VersionMSI.
Personally, I'm of the opinion that people don't really read the dialogs in an installer anyways so I rarely ask questions or tell important information. I'd move the "view website" type requirement to the first run of the application itself.

Drag items out of Outlook - record message ids

Background:
I am in the process of designing an application that will allow items to be dragged to it and will invoke some long running processes on them. The items will normally be dragged in from the filesystem and from Outlook. My concern is with the latter.
How can I hook into Outlook to find out if a message (or several) has been dragged out of it and on to my application and what the message ID is/are?
I understand that the Outlook object model does not have such drag/drop events and one solution is to listen to the Windows messages - this is not feasible in the team, as our combined Interop knowledge is not great.
We will be using C# 4.0 in Visual Studio 2010 for developing this application.
Even this is an old question, there is actually a way. It's undocumented, but I was able to reverse engineer this at least half way. I'm not sure though if the "Selection"-method is still cleaner, but I prefer to read the data directly.
A sample and the docs for this can be found here:
https://github.com/yasoonOfficial/outlook-dndprotocol
You cannot get access to the MailItem.EntryID directly from Outlook via the generic IDataObject drag-n-drop interface. If you just want to access the MSG data, then you can use this CodeProject example. Once an MSG is copied to disk (or clipboard, drag-n-dropped, etc.), it loses any reference to an EntryID.
The only way I know of to get access to the EntryID is by using VSTO and using the ActiveExplorer().Selection to see which items are selected at the time of the drop action. Here is an example of accessing the Body of a selected message during a drag-n-drop command. You should be able to find numerous examples once you see the general pattern being used.

What can I do to make my sub-derived custom control appear in the Blend Assets library?

I am creating a series of window mockup templates based on the excellent Mockups library available on CodePlex.
I'm using their BaseMockup as the base for my control as well, and I followed the same outline of the steps listed here for sub-deriving from existing controls (Create a new empty class, add your default style to /Themes/generic.xaml, etc.)
The control is working great - the only thing is that it doesn't show up in the Assets library. I think this is because it's sub-derived, or because I need some attribute (the equivalent of the ToolboxItemAttribute for WinForms controls? ... which didn't work) to get it hooked up.
When I modify the code to derive directly from Control, it shows up - no custom attribute necessary. Of course that defeats the purpose of what I'm trying to do though...
The only thing I can find are several articles telling me to muck with registry keys, and none of them are clear or suggest a definitive way to do this with Blend 4. That last one advertises as a Blend 4 tips article, but admits at the end that it plagiarizes the content from the other two (for Blend 3).
Is that my only option - register my DLL? Is there a better way to do this?
A while ago I wrote a blogpost about this. I've included a .reg file and a .bat file for setting up the register and some directories. I think that's what you are looking for.
I believe you do need to muck with registry keys. Specifically,
32 bit: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NET Framework\v4.0.30319\AssemblyFoldersEx
64 bit: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NET Framework\v4.0.30319\AssemblyFoldersEx
Create a new key with the name of your control assembly. Then edit the Default string value under this key and set the value to the directory where the control assemblies are installed. See here for a full example (using the Silverlight paths).
Found it - there is an analogue attribute after all, it's ToolboxBrowsableAttribute.
You have to go through a little more rigmarole to get it set up, but it works great - no registry mucking necessary. It requires creating a designer metadata provider class, attributing your assembly so it's designer-discoverable, and then adding the attributes to your sub-derived controls inside your metadata provider.
Make sure you choose the appropriate version of the page for your version of Visual Studio, because the interface changes a good bit between 2008 and 2010.
This article on CodeProject has some good, real-world examples of setting this up. They're all in the 2008 style though, so bear that in mind if you're using 2010.

One of X number of colums must contain data

HI all,
I am creating a timesheep app and I have five colums that can contain hours worked. When the user enters a new form how do I check to see if at least one of the columns contains data. I must admit I am not a developer just a Sharepoint/Sharepoint designer hack so be nice. Thanks
Glenn Thibeault
The only bullet-proof way would be to create a SharePoint event receiver using C# (lots of examples on the web).
I'm not really sure how you could accomplish this with SPD.
If you don't want to write any C# code, that really only leaves JavaScript. It will still take development work (this is a programming site after all). You could probably take advantage of SPUtility.js (full disclosure, this is a library I maintain).
The basic steps would be:
Edit your NewForm.aspx and add a Content Editor web part
Inside the Content Editor web part, write your JavaScript:
Attach a new onClick handler to the NewForm.aspx's "OK" buttons
Use SPUtility's GetValue method to get the value of your 5 fields, validate one has a value, and display a message if invalid

Resources