Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Using a Grid in IVF 9.1

roginski__robert
Beginner
1,688 Views

I recently acquired and installed IVF 9.1 and MS Visual Studio 2005. After downloading and applying all recent updates to both, I started to see what would be involved in converting one of my Windows applications. But I was not successful in getting any of the grid controls to work.

I'm certain there is something I'm not doing correctly but have no idea, or maybe this is simply not possible. I would really appreciate if someone out there could point me to a skeleton program that simply displays a grid that allows for in-cell editing.

Thank you.

0 Kudos
14 Replies
Steven_L_Intel1
Employee
1,688 Views
I am not familiar with "grid control" and a search on MSDN yields a collection of seemingly unrelated items. From what I do see, this is something provided in the .NET environment so it might be tricky (not impossible) to use from Intel Visual Fortran. What language is your existing application written in?
0 Kudos
roginski__robert
Beginner
1,688 Views

This particular application uses Lahey LF95 and the grid control in Winteracter by ISS. These are the tools currently supplied by my client. I was considering converting it to IVF 9.1 to take advantage of some of the features in the newer grid controls available in MS VS 2005, but it's starting to look like it may not be straightforward.

Anyway, thanks for the reply. I may still convert if I can find a relatively easy to implement Win32 grid control. There are a few available that I'm currently evaluating.

0 Kudos
Steven_L_Intel1
Employee
1,688 Views
Oh, if it's in Winteracter, you should be able to use it. How do you make the control available to the code? What doesn't work? I don't know if you have to get a version of Winteracter that was built for IVF.
0 Kudos
roginski__robert
Beginner
1,688 Views

Yes, the Winteracter grid works ok but - as I mentioned - has limited capability. Also, you must acquire the Winteracter version targeted for the compiler to be used. This means I am currently using the Lahey LF95 5.7 version of Winteracter.

I'm trying to get away from Lahey for numerous reasons. The primary ones are: (1) the upgrade for the IVF version would be costly at about $529.00, and (2) I would get the same limited grid control (they simply recompile their source with the user-specified compiler). On a positive note, the nice thing about Winteracter is that all the required interfaces are available in a Fortran module. This means that one needs no knowledge of C or C++ to call most Win32 routines. I have significant experience in mixed language issues using Fortran, C, VB and some assembler, but these issues are thoroughly explained in the manuals and help files. However, I cannot say the same thing about this grid control (or maybe ActiveX) issue. To me it's like buying a car and not getting the keys.

With regard to what doesn't work (in the MS VS grids) is something I cannot fully explain at this time. I just follow the instructions for calling ActiveX and COM controls and the grid fails to appear in the dialog. This is where acomplete working example program would be the best documentation. Code fragments and snippets have their purpose, but are not adequate when the project depends on so many settings.

I appreciate your response and hope that you will understand my frustration. If you should discover something please let me know. In the meantime, I am still evaluating other grid controls for Win32. If I can get one to show up in a dialog, it should be easy (although time-consuming) to write all the necessary function interfaces.

Thanks again.

0 Kudos
John4
Valued Contributor I
1,688 Views
I have a problem related to this thread, so I guess I you can use the solution attached to this message as an example.

The solution makes use of the MSFLEXGRID control, by means of the module generated by the IVF wizard.

Keep in mind that you need some sort of license in order to use the ActiveX with your application (in my case, that means having VB 6.0 installed in the computer). Also, a few inconsistencies in the module generated by the Wizard should require some editing (e.g., the use of the T_GUID type instead of GUID, some DLLEXPORTS and so on).

Right now my only problem is that I cannot find a way to effectively move the edit control to the active cell (in the VB way). The ActiveX routines return the coordinates for the active cell in Twips, the Windows functions work with pixels and the dialog box uses DLU units (I have routines to perform the conversions, but it still doesn't work).
0 Kudos
roginski__robert
Beginner
1,688 Views

John,

Thanks for the information. I'll give it a try and see if I can get it to work,in which caseyou will have saved me a few bucks. As I mentioned previously, I am using MS VS 2005 which comes with VB. I hope this qualifies me to use MSFLEXGRID. I'll report my findings in a future post.

Bob

0 Kudos
John4
Valued Contributor I
1,688 Views
As far as I know, the only way to use MSFLEXGRID from VS2005 is by having VB 6.0 installed... I remember that there was a registry key in VS.NET to enable the use of old ActiveX controls, but it seems that Microsoft decided to make such key unavailable for VS2005.
0 Kudos
roginski__robert
Beginner
1,688 Views

I'm not sure I understand what you mean here. Is it a requirement to have VB 6.0 installed in addition to the VB that comes with VS 2005? Also, were you able to locate and enable the registry key you mentioned, or did you just give up on using MSFLEXGRID?Your example project works (somewhat) on my system, although I did experience the quirks you previously described. On my system, an error and termination occurs when I click the Apply button.Could this is the result of not having that registry key set?

Now I'm curious about the workaround you have chosen to get past these issues. I'm still not sure if I should pursue MSFLEXGRID or just purchase one that is easier to use.

0 Kudos
John4
Valued Contributor I
1,688 Views
Yes, you understood very well. The MSFLEXGRID is not included with VS2005 (and by now you should know that VB.NET cannot be considered a strict successor of VB 6.0... Rather I see it as a weird version of Java with no semicolons and curly brackets).

If you have not experienced any problems while opening the resource file from VS2005 or running under debug mode, then your computer already has the corresponding registry key (maybe another program installed both the grid control and the registry key).

I decided to use the MSFLEXGRID, just because I read somewhere that both MSFLEXGRID/MSHFLEXGRID don't have the "database issues" of other similar grid controls (it was on the msdn web page, but the link seems to be broken by now)... So that makes them much easier to use, I guess.

Also, the application I attached is just a generic version of how to use any grid control with IVF (except for the KeyPress event, which is just a workaround), and you will probably have the same issues when using any other grid control (the analogous VB code can be found at http://support.microsoft.com/kb/q241355/).

As to the Apply button, it simply gets whatever it is on the flexgrid columns, stores the values in a real array, and writes it to a newly generated file. Maybe the error you have is related to the internal read (i.e., the line "read(Text, *) InputData(ii, jj)").
0 Kudos
roginski__robert
Beginner
1,688 Views

Thanks for all the valuable information. I finally figured out the Apply button, but still don't know where the MSFLEXGRID 6.0 control came from. I just assumed that it was included with MS VS 2005.

Anyway, I'm about 90% sure that I will convert my application to use IVF and MSFLEXGRID. I was in the process of evaluating a control named ZeeGrid which has sufficient capability at this time, but I may require something more powerful in the future. It was written in C++ so I had to convert the supplied ".h" file to an equivalentFortran module. Everything that I could test works, but the grid will not accept user input until it is unlocked by calling a function with the unlock code.This code is suppliedonly afterpurchasing (for $110 or $350 depending on the type of license required).

My only other real alternative is to use the DataGridView control in MS VS 2005. This has everything including ease of use, but I would probably need to create my interface using VB - something I would rather avoid. This control is one of those I could not get working in IVF 9.1.

If you don't mind, I still havea fewmore questions. Is there any document or help file available that describes how to use MSFLEXGRID? Otherwise, there are many settings and functions in file MSFLXGRD.f90 that must be examined just to locate the right one. Was this a big problem for you?

0 Kudos
g_f_thomas
Beginner
1,688 Views

The MSFLXGRD/MSHFLXGD that comes with VB6 are distributables but require a developer's license to use in an MS IDE.

Why not use the ocx's that come with the Compaq and Intel Array Viewers? These include a grid control that may or may not suit your purposes and their usage is documented. Additionally, they are free. You can use these in IVF dialog projects.

0 Kudos
John4
Valued Contributor I
1,688 Views
The DataGridView also looked like a good option to me, but it seems to be restricted to managed Forms (e.g., VB.NET, C++.NET, etc.). Besides, the documentation seems to insist too much on its usability just in terms of databases and web stuff.

The MSFLEXGRID description is part of the VB 6.0 documentation. You can take a look at it in the msdn web page (it contains the description on the properties, events and methods available for the control)... Just keep in mind that the IVF wizard generates getters and setters (i.e., for every property in the control, there exist two routines, one wit the Get-, and another one with the Set-, prefixes), which is very similar to the C++ way to handle ActiveX controls.
0 Kudos
roginski__robert
Beginner
1,688 Views
I am not familiar with The Array Visualizer, but the name implies that it displays a 1D or 2D (is 3D or higher possible?) array ofa singleuser-defined type. Feel free to correct me if I am wrong about this. One of my requirements is to allow the user to individually specify the column types, widths, ranges, etc. at run time, and this requires a grid control with features that support this. I appreciate your suggestion; it may come in handy in some future project.
0 Kudos
g_f_thomas
Beginner
1,688 Views

3D. RTM for full details.

Grid controls in Windows are limited to 2D. They are primarily for use with relational databases. If you work withnD arraysuse netCDF.

The IVF manual advises:

"Windows projects are much more complex than other kinds of Fortran projects. Before attempting to use the full capabilities of Windows programming, you should be comfortable with writing C applications and should familiarize yourself with the .NET Framework Software Development Kit (SDK)."

Dialog projects don't constitue a shortcut to circumventing the realities of Windows and MS is determined to ensure that it stays that way.

0 Kudos
Reply