|
keerthihaasan wrote: i should be able to view the contents of the corresponding csv file
Where would you like to see the contents ? In a edit control, list control, ... ?
Anyway, you have to split the problem in two parts: first is to read the data from the file. For this you can look at std::ifstream. And second part is to display your data. The way you do it is totally dependent on how you want to display it.
So please provide more information (as somebody already suggested).
|
|
|
|
|
Greetings,
I writing a program that will use the text which is within the Windows File Explorer status bar. Is there anyone who knows how this text is achieved? Is there a way to get this text while it is being sent to the status bar? Also, does anyone know how to get this text yourself without accessing the status bar/details section in the left area of the window?
Thanks in advance
"There is no teacher greater than experience." - Some dude from the PC game Jagged Alliance
|
|
|
|
|
How to use staticly allocated data in function calls with ** pointers?
void function(float** a)
{
a[0][0] = 1.0f;
a[1][3] = 2.0f;
}
int main()
{
float b[10][20];
float c[50][30];
float d[4][32];
function(b);
function(c);
function(d);
}
chesnokov
|
|
|
|
|
You can simply cast, i.e. function((float **)b); but then who will inform your function about the array bounds?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
in that case in function(float** a) e.g. a[0][0] start pointing to the wrong address, SEH is invoked.
_msize() tells all the array bounds.
chesnokov
|
|
|
|
|
Hi Friends,
I have written below code for checking whether windows machine is locked or not but its gives always window is locked though its not locked. Could anyone suggest what is wrong here or can give alternative solution?
bool lockedHost = false;
HMODULE hUser32;
FARPROC LockWorkStation;
hUser32 = GetModuleHandle("user32.dll");
if (hUser32) {
LockWorkStation = GetProcAddress(hUser32, "LockWorkStation");
if (LockWorkStation) {
lockedHost = true;
MessageBox(0, "locked1", "Info", MB_OK);
}
}
Thanks in advanced,
Paresh
|
|
|
|
|
Though I don't know how to check whether the workstation is locked or not.
But I do know what wrong with your code!
1、LockWorkStation = GetProcAddress(hUser32, "LockWorkStation");
Only return the function pointer of "LockWorkStation".Then you can use this function!
2、LockWorkStation is the function to lock workstation, not to check whether the workstation is locked or not. Do check MSDN!
Gurus may answer your question!
|
|
|
|
|
|
Hello everyone,
I am debugging an access violation exception dump (code xxxxxxxx access violation for memory address, exception code 0x00000005). It is 32-bit x86 code release version. I have used the command dd to examine the memory address (not code address) which reports access violaton. The content of the address is displayed as ???????? in debugger.
I double checked for the memory, it does not belong to any stack (using thread window to iterate all thread stack address space) memory address space, does not belong to any binary code (using load model window to verify).
My question is, for memory address which reports access violation and which content is ????????,
1. is it the memory address not allocated (or reserved) in current process virtual memory space?
2. or the memory address deleted? I have made some test that for the memory deleted on heap, its content will be marked with 0xfe, not ?. But I am not sure whether when the heap memory is recycled by OS memory mamagement system, it will be remarked as ????????
3. Or something else possible?
thanks in advance,
George
|
|
|
|
|
|
Sure Hamid!
I am using both Windbg and Visual Studio to debug this. Any comments or ideas to my original question?
regards,
George
|
|
|
|
|
Did you use of GetProcAddress on your code?
|
|
|
|
|
No, Hamid! The error happens when I tries to access a member variable of an instance of a class allocated on the heap. Any ideas?
regards,
George
|
|
|
|
|
Can you show your code that it generated this error?
|
|
|
|
|
Thanks Hamid,
The code is,
foo = someconstant;
The exception reports the accessing for foo variable throws the exception, any ideas?
regards,
George
|
|
|
|
|
With minimum minimum info I must answer to you?
|
|
|
|
|
What additional information do you need to debug this issue, Hamid?
regards,
George
|
|
|
|
|
Did you check your pointers?
|
|
|
|
|
Is this variable a member of a class ? If yes, check whether your class instance is valid.
Suppose you have a pointer to one of your class which is initialized to NULL. If you call a function on this instance, the function will get called and the crash will only appear when you access a member of your class. In general, it looks a bit weird at this level of the code but if you go one level higher in the callstack, you can immediately check the problem.
This is something that happens quite frequently and is a bit disturbing the first time.
|
|
|
|
|
Hi Cedric!
Is this variable a member of a class ? => yes.
How to check "whether your class instance is valid"?
regards,
George
|
|
|
|
|
George_George wrote: How to check "whether your class instance is valid"?
As I explained in my previous message: at the point of the crash (so when you assign the variable), check the call stack and go one level higher (so at the point where you call the function on your class instance). There check if the pointer is valid. Of course this is only the case if you are working with a pointer to your class.
If that's not the problem, then you have to post some more explicit code because it is almost impossible to help you.
|
|
|
|
|
Hi Cédric!
I find the instance variable itself is fine, but the field (member variable) of the instance is wrong with access violation error.
The member variable's address is 0x00d4cff0, and it is where the error occurs (exception dialog box reports the error).
Here is what I am using Windbg to get the information for the memory at this address. Do you have any further ideas what is the root cause of this issue? What means "PAGE_NOACCESS"?
0:001> !address 0x00d4cff0
00d0d000 : 00d0d000 - 00040000
Type 00000000
Protect 00000001 PAGE_NOACCESS
State 00010000 MEM_FREE
Usage RegionUsageFree
regards,
George
|
|
|
|
|
Please post some code about the function itself and the code where you call the function (and no pseudo code please).
|
|
|
|
|
Examine the this pointer (you can for example expand the this node in the debugger's watch window and look at the members, if you see a bunch of question marks and/or strange values (like, extremely high values for integers or negative numbers where there should ne none) then your this pointer is pointing somewhere it should not.
|
|
|
|
|
I'd guess the problem is a NULL pointer. For example, code like this would result in the same problem:
char *pMem = NULL;
pMem[5] = 0;
The ???????? indicates that there is no memory mapped at that virtual address (thus the exception).
Steve
|
|
|
|