|
Using WinDbg try these two commands:
bp kernel32!CreateFileA
bp kernel32!CreateFileW
Steve
|
|
|
|
|
Thanks, I didn't realize it was so easy with WinDbg.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Take a look at Microsofts public symbol server. You can download symbols for all their code from it, and set breakpoints and so on.
You can speciyf these sylbols in VS and when it tries to load downloads them automatically. I use windbg though so I cant help you much more than that, and I work in the kernel, but if you choose to do the same this is a usefull command:
bp nt!ntcreatefile "dt nt!_UNICODE_STRING poi(poi(@esp+0xc)+0x8)"
It sets a break point on createfile (this is what CreateFile maps to in the kernel) and displays the file being opened (This is 32 bit, if it was 64 the parameter would be in a register not on the stack).
SO any user mode acces to creatfile you can break on and have a wander arond the stack and see whats doing what.
--edit--
Or as the poster above says, set the bp in the usermode dll.
I can deffinitely recomend using windbg, it is a hell of a debugger, everyone in microsoft uses it, VS is a toy in comparison.
==============================
Nothing to say.
|
|
|
|
|
Erudite_Eric wrote: I can deffinitely recomend using windbg, it is a hell of a debugger, everyone in
microsoft uses it, VS is a toy in comparison.
Yes, but I have shyed away from it due to its complexity. I guess I'm just a dumb "user" at heart.
Maybe this will encourage me to try it.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
It is complex and command driven rather than UI driven, but what a command set! It can do amazing things.
==============================
Nothing to say.
|
|
|
|
|
I use the IDE's debugger when I can cause it's convenient and easy to use, but the second things get even a little complex I break out WinDbg.
Steve
|
|
|
|
|
Remote debugging over a network is one things VS is better at IMO.
==============================
Nothing to say.
|
|
|
|
|
My system is win7 64Bit
I use the VS2008 to compile the chrome solution. But I meet some problem about compile the FFMPEG.
I google that the others are all ok when compiling, but I have bad luck. I donot know why some error happen.
Does anyone meet the same problems?
1>------ 已启动生成: 项目: convert_ffmpeg_sources, 配置: Debug Win32 ------
1>Running external rules for convert_ffmpeg_sources
1>"python" "chromium/scripts/c99conv.py" "libavformat\oggparsedirac.c" "d:/Code/chromium/src/build/Debug/obj/global_intermediate/third_party/ffmpeg/libavformat/oggparsedirac.c" "-I" "chromium/config/Chromium/win/ia32"
1>cl: 命令行 error D8021 :无效的数值参数"/Fid:\Code\chromium\src\third_party\ffmpeg\libavformat\rmdec.c_preprocessed.c"
1>"python" "chromium/scripts/c99conv.py" "libavformat\oggparsevorbis.c" "d:/Code/chromium/src/build/Debug/obj/global_intermediate/third_party/ffmpeg/libavformat/oggparsevorbis.c" "-I" "chromium/config/Chromium/win/ia32"
1>cl: 命令行 error D8021 :无效的数值参数"/Fid:\Code\chromium\src\third_party\ffmpeg\libavformat\oggparsevorbis.c_preprocessed.c"
1>cl: 命令行 error D8021 :无效的数值参数"/Fid:\Code\chromium\src\third_party\ffmpeg\libavformat\oggparsedirac.c_preprocessed.c"
1>"python" "chromium/scripts/c99conv.py" "libavformat\rmdec.c" "d:/Code/chromium/src/build/Debug/obj/global_intermediate/third_party/ffmpeg/libavformat/rmdec.c" "-I" "chromium/config/Chromium/win/ia32"
1>make: *** [/cygdrive/d/Code/chromium/src/build/Debug/obj\global_intermediate\third_party\ffmpeg\libavformat\rmdec.c] Error 2
1>make: *** Waiting for unfinished jobs....
1>make: *** [/cygdrive/d/Code/chromium/src/build/Debug/obj\global_intermediate\third_party\ffmpeg\libavformat\oggparsevorbis.c] Error 2
1>make: *** [/cygdrive/d/Code/chromium/src/build/Debug/obj\global_intermediate\third_party\ffmpeg\libavformat\oggparsedirac.c] Error 2
2>------ 已启动生成: 项目: content_browser, 配置: Debug Win32 ------
|
|
|
|
|
See here[^] for D8021 errors; check the flags in your make file(s).
Use the best guess
|
|
|
|
|
Hi All, many thanks up-front to anyone who can help here.
I have a client that wants me to migrate a CTreeView-derived class to one which works like a docking pane. The class is so large now that it's not feasible to rewrite everything.
So...I still have the underlying CTreeCtrl-derived class (more/less untouched), which is a child of a class derived from CDockablePane (migrated from the CView class). I've also derived from CMultiPaneFrameWnd (used when the pane is floating) to try to trap events.
I've got it working about 80%. I need help/direction with the other 20%. I've got the CDockablePane derived class working with bulk of the MESSAGE_MAP events (menu handlers, ON_UPDATE_COMMAND_UI, etc.) working correctly. The events associated with the mouse are giving me grief.
I see 3 standard modes for the dockable pane: floating, docked, and tabbed. And they all behave differently w/r to mouse events - and depending on the docking mode.
For example:
* If the docking mode is DT_SMART *and* the pane is NOT floating, then drag&drop and double-clicking work correctly.
* If the docking mode isn't DT_SMART, then drag&drop usually tries to drag the complete docking pane instead of working correctly (regardless of floating, docked, tabbed).
* When the pane is floating, I can't trap WM_LBUTTONDBLCLK (unless you click on the lines and little [+] boxes...) or the respective notify or reflect messages - even Spy++ doesn't record them. I just don't see any left button double-click events - at all!
Google searches show that I'm not the only one with these types of issues. I've read and tried pretty well every suggestion...and I still have these issues. I'm now concerned about bugs or assumptions in the framework after reading this:
http://connect.microsoft.com/VisualStudio/feedback/details/641096/cdockablepane-calls-releasecapture[^]
This link: http://www.johnbyrd.org/blog/index.php?itemid=405[^] helped a lot but didn't solve all issues either.
I can also replicate these issues (unable to trap double-clicking when floating) in the VisualStudioDemo feature pack demo.
Any suggestions on how to get a CTreeCtrl to work inside a CDockingPane - consistently - would be really appreciated. I feel that many issues are related to CMultiPaneFrameWnd, but can't resolve them.
Thanks!
|
|
|
|
|
Hm... My trees can register the double clicks in their floating panes
For example, it is possible to extend a node by the double click at its item...
The model in my case is (from outside): CXDocablePane->CXFrameWndEx->CXTreeCtrl
They sought it with thimbles, they sought it with care;
They pursued it with forks and hope;
They threatened its life with a railway-share;
They charmed it with smiles and soap.
|
|
|
|
|
Found it! There is an intermediate class which inherited from CTreeCtrl. It was originally set up to support a CView, and forwarded the LButtonDown event to its parent. Well, now that the parent is a dockable pane, the behaviour changed a lot! Removing that handler got lots of stuff working!
|
|
|
|
|
i know accessing was ok with windows 98/me but with windows 7 it cannot be done.
but i have read that they can be accessed by making some drivers orany extra special drivers for this !! help needed realy hard time !! i work on windows 7 now and getting win 98is a big issue for me !! help ! 
|
|
|
|
|
What exactly is your C/C++/MFC question? What code have you put together that you need help with?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
If a PC running Windows 7 has a parallel port then you will probably find that it also has a driver. Now try posting a proper question, and stop filling your post with all those pointless emoticons.
Use the best guess
|
|
|
|
|
The windows API will support paralell port acces the same way it does serial port. You need to do a CreateFile() on \\\\.\\Lpt1 or some such. Look at the DeviceIOControl codes you can use to control it.
Dont try writing a driver, you will probably spend a year getting it working.
==============================
Nothing to say.
|
|
|
|
|
Here[^] is a good example that show you how to access paralel port in any OS. I hope to help you ...
|
|
|
|
|
Hi Folks... Having a hard time to figure out if we can call Rest Based Web Service API's in C++. Need to pass the secret Key to the Server and get back the response. Any idea or pointer or framework in C++ would be useful.
Any sample application will be useful.
Can it be done using sockets programming?
|
|
|
|
|
raghunath sahoo wrote: Having a hard time to figure out if we can call Rest Based Web Service API's in C++
You can do just about anything in C++. Having said that, it might not be your easiest solution. Higher level languages tend to have better abstraction for certain things.
raghunath sahoo wrote: Can it be done using sockets programming?
Of course it can be done using socket programming, how exactly do you think web services work? Problem with developers that work at a high level is they don't seem to know about the magic that's happening in the background. Simple answer: the web works over sockets.
I just typed "REST C++" in google and got a bunch of results, why don't you try one of those?
|
|
|
|
|
Thanks Albert... I had googled out earlier for the same...the links had no relevant information. The few pointers which are shown use may be other language framework to have the connection established.
I would rather just check out how win sock will be working.
Beacuse of the urgency just to write the code entirely in c++ and using any service or framework avalable or any one having worked in it... will be helpful to guide... as really am clueless.
|
|
|
|
|
http://www.codeproject.com/Articles/3849/Simple-HTTP-Client-using-WININET
This link is helpful.
|
|
|
|
|
Network stack goes something like this...
Socket->Raw Ethernet->IP->TCP->HTTP->Web Pages/Services
So basically, the sockets can be programmed with whatever language you want and everything else is layers that go above (or below) your base communication layer. Some languages offer higher abstraction so for example, you can get straight to web services without knowing anything about the other layers. Sometimes it's beneficial to keep things abstract to get things done quickly, but I'd personally recommend you at least know about the inner workings of things.
Here's a project[^] for C++ that deals with REST, it's from MS (I believe).
|
|
|
|
|
Here is the test code:
http://codepad.org/zKTatneG[^]
struct Empty
{
};
struct JustLong
{
long data;
};
struct LongAndEmpty : public JustLong, private Empty
{
};
struct StringAndEmpty: public std::string, private Empty
{
};
int main()
{
cout << "Empty:" << sizeof(Empty) << endl;
cout << "JustLong:" << sizeof(JustLong) << endl;
cout << "String:" << sizeof(std::string) << endl;
cout << "LongAndEmpty:" << sizeof(LongAndEmpty) << endl;
cout << "StringAndEmpty:" << sizeof(StringAndEmpty) << endl;
return 0;
}
When you try it in other compiler (for example, see link above for codepad.org), results are correct, i.e. output looks like this:
Empty:1
JustLong:4
String:4
LongAndEmpty:4
StringAndEmpty:4
Now, when you try this in VC++ (2010), size of struct with std::string is always (debug and release) 4 more that size of just std::string. Any other structs/classes are of correct size, and only those with std::string are bigger than they should be. Am I missing something or this is MS bug?
|
|
|
|
|
First it's not technically a bug unless it either doesn't work or doesn't meet the C++ spec. I don't think either of these things is the case.
Second it looks much more likely that StringAndEmpty is larger because it's derived from an already complex class the v-table for which is compiled into an external module. It's a guess but I reckon you've got an extra pointer in there to look up the pre-existing std::string vtable.
I have read a full explanation of the various sizes and formats of MSVC and other compilers minimal/empty/simple/complex structs and classes with and without virtual inheritance. I can neither remember all the details nor where I read it but I do remember that there were a lot more variations 4-byte, 8-byte, 12-byte, 16-byte, 20-byte 'headers' than I would ever have thought and much of the variation was within one type of compiler rather than between them. If I remember where that detailed research is I'll post a link.
"The secret of happiness is freedom, and the secret of freedom, courage."
Thucydides (B.C. 460-400)
|
|
|
|
|
Well, consider the following struct:
struct JustString: public std::string
{
};
It has the same size as just std::string, so no, there is no extra pointer in VFT. The question I have is about Empty Base Class Optimization - size of empty base class should be reduced to zero in descendant if possible. Yes, it is not a requirement, only a suggestion in a standard. Problem is, I don't understand this: it works for non-MS compilers; in MS-compiler it works for all cases EXCEPT std:string. I will check later with VC++ 2012 to see if they made it work, but right now I have no other explanation than some problems with MS compiler. Or is there any compiler option specifically for this case that I don't know about?
|
|
|
|