Click here to Skip to main content
15,887,214 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: BindToObject fails - DirectShow remote graph access Pin
Vaclav_12-Apr-13 4:32
Vaclav_12-Apr-13 4:32 
GeneralRe: BindToObject fails - DirectShow remote graph access Pin
Richard MacCutchan12-Apr-13 4:58
mveRichard MacCutchan12-Apr-13 4:58 
QuestionGetLastInputInfo getting system wide idle info Pin
Donguy197611-Apr-13 6:52
Donguy197611-Apr-13 6:52 
AnswerRe: GetLastInputInfo getting system wide idle info Pin
jeron111-Apr-13 7:31
jeron111-Apr-13 7:31 
Question[VC++ and XAML] Keydown event bug for metro app programming Pin
Member 997974310-Apr-13 19:35
professionalMember 997974310-Apr-13 19:35 
GeneralRe: [VC++ and XAML] Keydown event bug for metro app programming Pin
enhzflep10-Apr-13 21:15
enhzflep10-Apr-13 21:15 
AnswerRe: [VC++ and XAML] Keydown event bug for metro app programming Pin
dusty_dex11-Apr-13 0:49
dusty_dex11-Apr-13 0:49 
Question"Creating variable" at runtime - message decoding Pin
HellMaster[cz]10-Apr-13 19:03
HellMaster[cz]10-Apr-13 19:03 
Hi guys,

here is my problem description:

I receive messages over a bus. Suppose there is a function to read the messages storing them into a struct defined as follows:

typedef struct
{

ULONG timestamp;
BYTE ID;
BYTE data_length;
BYTE data[8];

} MSG_FRAME;

Depending on the message ID different messages represent different values for one project.
For example msg with ID 10 can include in the 8 bytes something like:

width: 6 bits
height: 6 bits
actpos: 12 bits
maxpos: 12 bits
minpos: 12 bits
range: 16 bits
total: 64 bits = 8 bytes

Here comes the tricky part. I want to print out the specific information hidden in the 8 bytes. I can define the structures for every msg ID and compile the program with this "special" header file, but I want to do it during runtime of the program, loading the information regarding the msgs, because i can have different projects where the information for different msg IDs can differ.

I've a non-C file, where basically all the information is written. Lets stay frame named

GetStatus{
bit 0 - 7 width
bit 8 - 15 height
.
.
.
}

etc.

How to read it on runtime and decode the messages? On runtime I'm not able to create variables and structures anymore!

Any advices? Is some sort of scripting language the solution? Which, how? Smile | :)

Thanks in advance for all replays!
AnswerRe: "Creating variable" at runtime - message decoding Pin
Richard MacCutchan10-Apr-13 21:41
mveRichard MacCutchan10-Apr-13 21:41 
GeneralRe: "Creating variable" at runtime - message decoding Pin
HellMaster[cz]10-Apr-13 22:10
HellMaster[cz]10-Apr-13 22:10 
GeneralRe: "Creating variable" at runtime - message decoding Pin
Richard MacCutchan10-Apr-13 22:34
mveRichard MacCutchan10-Apr-13 22:34 
GeneralRe: "Creating variable" at runtime - message decoding Pin
HellMaster[cz]10-Apr-13 23:15
HellMaster[cz]10-Apr-13 23:15 
GeneralRe: "Creating variable" at runtime - message decoding Pin
Richard MacCutchan10-Apr-13 23:22
mveRichard MacCutchan10-Apr-13 23:22 
GeneralRe: "Creating variable" at runtime - message decoding Pin
HellMaster[cz]10-Apr-13 23:27
HellMaster[cz]10-Apr-13 23:27 
GeneralRe: "Creating variable" at runtime - message decoding Pin
Jonathan Davies11-Apr-13 0:17
Jonathan Davies11-Apr-13 0:17 
AnswerRe: "Creating variable" at runtime - message decoding Pin
Jonathan Davies10-Apr-13 22:47
Jonathan Davies10-Apr-13 22:47 
GeneralRe: "Creating variable" at runtime - message decoding Pin
HellMaster[cz]10-Apr-13 23:24
HellMaster[cz]10-Apr-13 23:24 
GeneralRe: "Creating variable" at runtime - message decoding Pin
Jonathan Davies11-Apr-13 0:11
Jonathan Davies11-Apr-13 0:11 
AnswerRe: "Creating variable" at runtime - message decoding Pin
Erudite_Eric12-Apr-13 0:55
Erudite_Eric12-Apr-13 0:55 
Questioncrop window region and save as image (win32) Pin
Member 916988710-Apr-13 18:55
Member 916988710-Apr-13 18:55 
AnswerRe: crop window region and save as image (win32) Pin
Richard MacCutchan10-Apr-13 21:48
mveRichard MacCutchan10-Apr-13 21:48 
QuestionHow to use GetLastInputInfo? Pin
Donguy197610-Apr-13 15:58
Donguy197610-Apr-13 15:58 
AnswerRe: How to use GetLastInputInfo? Pin
Randor 10-Apr-13 16:16
professional Randor 10-Apr-13 16:16 
GeneralRe: How to use GetLastInputInfo? Pin
Donguy197611-Apr-13 6:50
Donguy197611-Apr-13 6:50 
QuestionError for GetLastInputInfo Pin
Donguy197610-Apr-13 11:36
Donguy197610-Apr-13 11:36 

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.