|
What do you mean exactly by "pszParse becomes invalid" ? What is your program doing ?
|
|
|
|
|
It gets changed from its current location, pointing to a location in the input hex string, to another seemingly random one. In most cases this throws a access violation when it is next used, but not always.
|
|
|
|
|
If you look at the type fields documentation[^] you can see that providing 'x' means that you want to read an hexadecimal integer. The result should be stored in an integer, not in a byte. The sscanf_s is probably corrupting memory when trying to write the integer to the byte you provided. Try with to supply an integer instead (you'll need to retrieve the first byte of the integer after it but a simple cast will do it).
|
|
|
|
|
Thanks Cedric, that worked a treat. Somthing else for me to look out for in future. Thank you!
|
|
|
|
|
int CreateArray(void** data, unsigned int* size)
{
}
int main()
{
unsigned char* data = 0;
unsigned int size;
int res = CreateArray(&data, &size);
}
Is it possible to avoid void* pData in main function and pass directly data pointer?
Чесноков
|
|
|
|
|
You may perform a cast.
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]
|
|
|
|
|
CreateArray(&(void *)data) does not work.
What is the correct one?
Чесноков
|
|
|
|
|
The other one:
int res = CreateArray((void **) &data, &size);
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]
|
|
|
|
|
that one is great, thanks.
Чесноков
|
|
|
|
|
Hello Guys
i am reading a tiff file and i m having all its image data with other tags too,now I want to show this image in frame window.How can I do this in MFC?
Is something thru OpenDocumentFile()?
Any Ideas??
Regards
Yogesh
|
|
|
|
|
I'm trying to auto-scroll while dragging; this is the gist of my code:
In OnLButtonDown I capture the mouse.
In OnMouseMove I set a timer to an initial value.
In OnTimer I send a WM_VSCROLL message and reset the timer to a shorter interval.
So when I stop moving the mouse, the scrolling happens, but only at the rate of the longer (initial) interval. Lots of investigation reveals that OnMouseMove is being called again, AFTER I send the WM_VSCROLL, even though the mouse has not been moved, and so the timer is being reset to the longer value. Is Windows somehow generating extra WM_MOUSEMOVE messages in response to the WM_VSCROLL? I'm completely mystified.
In case it's relevant, the WM_VSCROLL is sent to a different window to the one that did the mouse capture.
|
|
|
|
|
You might find here [^] what you looking for ...
|
|
|
|
|
Thanks, but I was looking for information about extra mouse messages.
Further debugging suggests that Windows generates a mouse-move message at various odd times, even though the mouse has not moved. For example, if I set a breakpoint in OnMouseMove, it is triggered immediately. I hit F5 to continue running the app (being careful not to touch the mouse), and the breakpoint is triggered again. It seems that Windows sends a mouse-move message when it activates a window, perhaps just to remind it where the mouse is. Does anyone know for sure whether or not that is the case, and what other circumstances may lead to spurious mouse-move messages?
|
|
|
|
|
hello guys....i have written some code in C# (did some database work in C# using ADO.NET). Now I dont want to do that from scratch in vc, i just want to add that class to my vc prject and do my job. Is it possible, if yes how??....thnx
|
|
|
|
|
when you build a DLL in one .NET language, it can be used by other DLL or EXE files created using another .NET language, without you actually see the language difference. Just make sure you add a reference to the DLL (solution pane), import the namespace (that would be a "using" in C#), and start using your other-language types.
The above implies you meant C++/CLI, i.e. managed C++; and if you did, you actually are asking in the wrong forum.
|
|
|
|
|
Luc Pattyn wrote: you actually are asking in the wrong forum
well since i was trying to add C# class to my managed C++ project so I thought this to be the right forum. Thanks anyways
|
|
|
|
|
The C/C++/MFC forum is for native code, i.e. unmanaged, non-dotnet stuff.
The C++/CLI forum is for managed C++ code, as is used (by a few) in the .NET framework.
|
|
|
|
|
yes it can be done in vc also.
|
|
|
|
|
Hiii
I wanna know the term "IP Stack". What does it contain? What is the purpose of it? Where it resides inside Operating system?
Thanking you
Krish
|
|
|
|
|
If you want to know basics then this[^] is always the best place to start.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Is 'your' Google broken, today?
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]
|
|
|
|
|
|
bleedingfingers wrote: Let me google that.
Let me google bing that.
FTFY.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
Visit the Hindi forum here.
|
|
|
|
|
No, google is actually a verb found in the dictionary which means to search the web, yeah...eat it M$ fanboy...
|
|
|
|
|
Hi i have to read a binary file from disk and i have to transfer file through serial port. i am using mscomm1 in vc++ 6.0.
Please help how to transfer a binary file through serial port.
|
|
|
|