Click here to Skip to main content
15,889,867 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
QuestionZOOM in PICTUREBOX Problem !!!!!!!! Pin
hbjs16-Feb-06 19:46
hbjs16-Feb-06 19:46 
QuestionNative Types outside assembly Pin
Kordzik16-Feb-06 12:57
Kordzik16-Feb-06 12:57 
AnswerRe: Native Types outside assembly Pin
George L. Jackson16-Feb-06 13:02
George L. Jackson16-Feb-06 13:02 
GeneralRe: Native Types outside assembly Pin
Kordzik17-Feb-06 7:59
Kordzik17-Feb-06 7:59 
QuestionCCmdTarget destructor asserts while destroying sink object... Pin
chervu16-Feb-06 8:30
chervu16-Feb-06 8:30 
Questioncreating a student class Pin
civicrico2316-Feb-06 7:22
civicrico2316-Feb-06 7:22 
AnswerRe: creating a student class Pin
malharone16-Feb-06 7:36
malharone16-Feb-06 7:36 
QuestionLooking for help in program design Pin
ldsdbomber16-Feb-06 5:42
ldsdbomber16-Feb-06 5:42 
Any help would be gratefully received. You should see from my email address that I'm not trying to get "homework" done for them, in fact this program will be used in QA of clinical treatments so it's vey useful!

I was a programmer for 3-4 years for Infogrames (games), mainly working on export tools for 3D Studio Max, working with the Max SDK and Win32/MFC dialog apps for artists. I learnt programming on the job, and never really had any background knowledge, so I wasn't going to win any awards for my code, and I certainly didn't have the skills to go beyond the stuff I worked on routinely.

I've been away from coding for a while but now I need to get back into it as part of my job here, after a break of 4 or more years. I'm trying to get some good books and learn *properly* the C++ language from the ground up to get the basics, but this project needed to be done a.s.a.p

I did get the program to work with an MFC dialog (see below) but it's very ugly and I can already see "sort of" how it should be done properly with a class or two, maybe even use STL, but I wanted to ask if anyone could spare the time to suggest a good way to deal with it, even just in design terms (though code snippets would be great also!)

Here is the file format which is exported from a medical instrument.

Measurement Export Matrixscan 1.1
Date: 20/01/2006 11:47:01
Cols:27
Rows:27
Measurement Values:
2.314591E-02;2.654959E-02;2.981629E-02;

I've trimmed the values, in actual fact it can be up to 27 rows of 27 items, separated by semi colon (and not always square array!)

What my program is doing in a very ugly way is using Getline on a file stream to read in each line bit by bit, using colon separators at first to get the header info, then using semi colons on the data after creating a new float array.

At the moment I'm only reading in the central row and column into 2 separate arrays (but I'm going to change that to read the whole array and then be able to process any row or column)

For each of the two arrays thus extracted I have to:

- use the centre point as the 100% value
- work out 50% value, and using interpolation, work out which fractional array index that refers to to get an effective field size, eg, if the 50% value is between array[3] and array[4], I interpolate to get an answer of 3.xx. This occurs in two places, one before and one after the centre point (these are 2D profiles shaped like a top hat but with a dip in the middle of the profile).
- Once I have the field size for each array, I work out 80% of that field size, and then have to work out which elements in the array fall within those values, so if I get a field size of 21.1 cm (each array element in the data is 1 cm apart), that means 10.55 either side of the middle element, so I would include only the 10 elements each side of the centre
* upgraded this bit to do the same but using the whole 2D array
- I then go along each row/column and look at corresponding data points equidistant from the centre. Eg, if array[13] is the middle of a 27 sized array, I compare array12 and array 14, array11 and array15, to work out the biggest ratio between those pairs, and which side of the centre it occurs
- I also work out the highest and lowest value in the whole array within the 80% section of the 50% region (relative to the centre point)

I have this as an MFC Dialog which uses CFileDialog to open a list of files (OFN_MULTISELECT) then a process button to process the selected file, which is all done in one big block top to bottom in a single function, with no real error checking and I'm sure lots of redundancy

I have a feeling a better way to do this would be to have a 2DArray type class, with array data and header details, have functions to load and process this data, perhaps have more generic file import class? and also more generic array processing to allow me to "get" a specific element, row or column from the 2D array which I currently store as a 1D array and use indexes to look up a specific cell


I hope that makes sense, any comments or feedback welcome, and you can email me if you want to discuss further

cheers,
lee

QuestionUndefined symbol Pin
Ed.Poore15-Feb-06 11:20
Ed.Poore15-Feb-06 11:20 
Question[Message Deleted] Pin
48d205815-Feb-06 4:59
48d205815-Feb-06 4:59 
AnswerRe: How to fix this bug? Pin
George L. Jackson15-Feb-06 12:49
George L. Jackson15-Feb-06 12:49 
QuestionUsing MemoryStream Pin
Daniel Odom14-Feb-06 11:28
Daniel Odom14-Feb-06 11:28 
AnswerRe: Using MemoryStream Pin
George L. Jackson15-Feb-06 12:56
George L. Jackson15-Feb-06 12:56 
QuestionSystem::Web::?? Pin
Ed K14-Feb-06 11:12
Ed K14-Feb-06 11:12 
AnswerRe: System::Web::?? Pin
George L. Jackson14-Feb-06 12:53
George L. Jackson14-Feb-06 12:53 
AnswerRe: System::Web::?? Pin
Ed K15-Feb-06 4:44
Ed K15-Feb-06 4:44 
GeneralRe: System::Web::?? Pin
George L. Jackson15-Feb-06 14:28
George L. Jackson15-Feb-06 14:28 
AnswerRe: System::Web::?? Pin
Ed K15-Feb-06 15:05
Ed K15-Feb-06 15:05 
GeneralRe: System::Web::?? Pin
George L. Jackson15-Feb-06 15:35
George L. Jackson15-Feb-06 15:35 
GeneralRe: System::Web::?? Pin
George L. Jackson15-Feb-06 16:05
George L. Jackson15-Feb-06 16:05 
GeneralRe: System::Web::?? Pin
Ed K16-Feb-06 10:15
Ed K16-Feb-06 10:15 
GeneralRe: System::Web::?? Pin
George L. Jackson16-Feb-06 11:17
George L. Jackson16-Feb-06 11:17 
QuestionHow to implement multi-threading in C++ Pin
Amarelia13-Feb-06 23:26
Amarelia13-Feb-06 23:26 
AnswerRe: How to implement multi-threading in C++ Pin
toxcct13-Feb-06 23:55
toxcct13-Feb-06 23:55 
GeneralRe: How to implement multi-threading in C++ Pin
Nick_Kisialiou14-Feb-06 16:20
Nick_Kisialiou14-Feb-06 16:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.