|
I am not sure what is going on, but both of these appear to be warnings, if they where not then they would be much higher values, or much lower in decimal (negative). That is the Most Significant Bit (MSB) would be set. If I am correct and slapping a 'C' in front of the number gives the actual messages you are seeing, then C4098 (Level 1) progably just copies the return value to a register, which is simple to fix. I am suprised that 'C++' did not report that as an error. The other warning, and it is a warning, C4075 (Level 1) has to do with the order in which global objects are created. That one worries me a little, but there is a good chance that the initializations are occuring in an order that that will do no harm.
As for the value 'temp', that depends on how it is being used. If it is not in your code then you can probably ingnore it.
If the thread is exiting with code 0, then that means nothing went wrong while executing that thread. That does not mean that some thing could not go wrong.
The fact that the code from Microsoft stopped at a user defined break point does not mean there is an error in your code.
What you need to do is test the code compiled in realise mode. That is more difficult, but we do not get warnings when running in realise mode, only errors (if we are lucky).
The first version a Bounds Checker I bought, allowed me to reject an out sourced program repeatedly until they gave me the source code. It took me five minutes to figure out why Bounds Checker was objecting to the program. My manager did not believe me util I said "if I was to do this, the program would crash". He said "Ok do it", when I did the whole system crashed.
What you are seeing are warnings, that does not mean you can ignore them. What it means is that you should understand them, at least well enough to realise if they are actualy a problem or not.
Blast, I did it again! I tend to get carried away with my explinations. I do not know if any of the above helped you, but I hoped it did.
Good Luck,
INTP
Every thing is relative...
|
|
|
|
|
Hey thanks. I'll try that realise mode.
|
|
|
|
|
Hi All,
I am implementing Drag n Drop between My Namespace extension and Windows folders.The data in "My Namespace extension" does not exist on the user's machine. When the user drags a file from "My Namespace extension" and drops it on a windows folder, I am downloading that file to a specific directory on the users machine and from there putting it in the DataObject.
But the whole thing is not working. I am getting the following error message.
"Cannot Copy file: cannot read from source file or disk"
Can someone tell me what could be going wrong here?
Thanks and Regards,
Anil
|
|
|
|
|
It would depend on from where you are trying to download the data?
just a wild guess, are you trying to put a namespace extention interface for a symbian phone ?
|
|
|
|
|
I am downloading the data from a database
|
|
|
|
|
What actually happens is I am putting the information about the file in my implementation of IDataObject and in the GetData function of IDataObject, I am using that information to communicate with Applet which in turn will download that File from the Database to the client machine.
Hope I am clear now.
Thanks and Regards,
Anil
|
|
|
|
|
There are several things to be considered while performing this operation. Its not easy as it seems. When a Drop event occurs in the Windows folder, It will immediately start querying for the type and the IDataObject.
You can implement this functionality by implementing the file->copy process in IDataObject::GetData(...)
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
XMinds
|
|
|
|
|
Jagadeesh, thats exactly what I am doing here, I am dowloading the file in the Getdata method and am putting it in the STGMEDIUM structure there...but still something seems to be missing....
|
|
|
|
|
In my MDI project. MainFrame has a m_CoolBarCtrl, m_TabCtrl and m_DirTreeCtrl. they are all dynamically created. in the Create funcation specify parent CWnd.
m_CoolBarCtrl parent is MainFrame
m_TabCtrl parent is m_CoolBarCtrl
m_DirTreeCtrl parent is m_TabCtrl
When user click on a abc.cpp file in the DirTree, I want to notify the main frame to open this file.
How can I implement this? Please give me a direction.
|
|
|
|
|
Use AfxGetMainWnd() and dynamic_cast to obtain a valid pointer to CMainFrame. Then Call the method to open the file. Thats it!!!
Alternatively you can send a message to the Mainframe HWND and handle it accrodingly in your CMainFrame class. But I suggest using the first approach.
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
XMinds
|
|
|
|
|
hi,
How to Resize Dialog and Controls when Desktop resolution is changed, in VC++ Dialog based application?.
Thax,
Om
|
|
|
|
|
You need to handle WM_DISPLAYCHANGE message and then resize your dialog accordingly.
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
XMinds
|
|
|
|
|
in addition to above post you can check WM_SETTINGCHANGE [Windows] tooo
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow cheers, Alok Gupta VC Forum Q&A :- I/ IV
|
|
|
|
|
Please can any one help me by providing any VC++ project wid source code. It can be as simple as possible.If the person can also provide wid the documentation of the same project that will be great.In case if no documentation is avail no rpblem,main is teh project.Please....
COOKIE
|
|
|
|
|
This site is full of projects with source code!!!
Checkout C++/MFC section.
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
Sure! Lets see, select file->new->projects->Win32 Console Application and follow the prompts. You now have VC++ source code that is as simple as possible.
Sorry, but you need to be more specific as to your requirements. There are hundreds of articles at CP and a great many of them cover what you are looking for. Even if you went to the CP home page and clicked a link at random along the left edge of the screen, the odds are good that you will hit a link that meets your requirments.
INTP
Every thing is relative...
|
|
|
|
|
First of all, sorry so long. I'm pulling my hair out on this problem! Check out the short description below and skip if not interested or beyond your level of expertise.
The short: I have intermittent problems communicating using TCP/IP on Windows XP Service Pack 2 with a pKernel (Posix compliant) embedded device. The embedded device is external to the PC and communicates with a PC via ethernet and/or serial port. Ethereal (sniffer) run on my XP SP2 laptop shows connection requests (SYN) are seen by Ethereal, after the embedded device is reset, but not seen by Windows XP. I am strongly leaning towards this being exclusively an XP SP2 problem but have some doubts that it may be my embedded device.
Details:
1. Problem only occurs on Windows XP SP2. I have tested with Win98 and Win2K and everything is fine. Also this problem did not occur with XP Service Pack 1. Win XP service pack 2 includes several network security things (no details) including a time client. My time server is RFC-868 compliant, referred as Time Protocol, server, and uses TCP/IP or UDP port 37. The SP2 time client is not enabled by default and uses a different port so it is not causing the problem. Some of the SP2 changes were available as add-ons to SP1 but I did not try them.
2. If time server app or service is restarted, the embedded device connects to my XP SP2 machine, every time. It is only when the embedded device is reset or powered off/on, that the embedded device cannot connect to the XP SP2 machine. Eventually after multiple resets, a connection occurs. Once a connection is made, I can re-connect endlessly as many times as desired until I reset the embedded device.
3. Problem initially was discovered with a time server module I embedded into my application. It was later discovered the problem also happens with a TFTP server module, I embedded into my application.
4. Problem was confirmed using third party time server application and third party TFTP server application.
5. Saw some Microsoft documentation that said servers should be installed and run as a service on Windows XP so I made a standalone service for the time server, and it works in Win2K flawlessly, but still fails the same way on XP SP2.
6. The embedded device tries to get time from a time server on booting up or reset, then it sets its time, and runs any onboard (flashed) application. The kernel calls a kernel library (inetlib) function, I think called cmd_ntime() to retrieve the time. As a test, I wrote a test application for the embedded device, that called the same function. FAILED. Later, I rewrote another application for the embedded device. This application was a time client (instead of calling the kernel function) that requested time from the XP SP2 machine. FAILED. Both of these test apps looped and requested time every 4 seconds. IMPORTANT: I should say that since it ran every 4 seconds, I was able to verify through debug msgs on the serial port and via Ethereal, that the application program was waiting for the connection to complete. After about a minute and a half, it inevitably connects successfully and from that point on, I can get time every 4 seconds.
7. There are no firewalls running. The problem is repeatable on numerous PCs running XP SP2.
8. ARP and MAC addresses for both the embedded device and the XP SP2 machine seem OK. I verified on the XP SP2 machine that a dynamic table was built that held/had the embedded devices MAC/IP.
When running Ethereal and seeing that a TCP/IP connection is initiated from the embedded device by send a SYN packet, it appears that XP SP2 is not seeing it but the sniffer is. Not knowing networking and driver layers that well, we strongly suspect that one possiblity may be that the SYN connection request is not being passed up the layers correctly.
Freaky Things:
I can actually get it to work, if I don't clean up my sockets i.e. don't do a shutdown() and close() socket. I have tried blocking and non-blocking (currently non-blocking using FD_SET). Documentation says that FD_SET and macros support 64 sockets and can be made to handle more sockets by resizing the structure. HOWEVER, when it does work, there are still problems. Ethereal reports a DUPlicate ACK to the initial SYN e.g. embed dev [SYN], XP SP2 [SYN,ACK].
I actually had a third party time client application which I tested on all operating systems. It also failed with XP SP2. But when I recoded my time server into a service, it now works every single time from the XP SP2 laptop or from another machine.
We have verified the cables, hubs, network adapters, (all networking hardware) are all working fine. The embedded device transmits plenty of UDP data just fine.
HERE'S WHERE I NEED HELP. Is there a sniffer (or does my current one) sniff all OSI layers? If not, does Microsoft have some sort of sniffer or debugger that would perhaps show me the data or TCP/IP connection request being passed up the layers?
Any other suggestions would be greatly appreciated. I have been working on this for over 3 weeks starting multi-threaded spawning threads for each connection request to eventually a test configuration of non-blocking service without threading. I've pulled any code that might hinder isolating this problem. THANK YOU.
-- modified at 22:47 Thursday 2nd February, 2006
|
|
|
|
|
I have a MFC application that has a lot of list view in report mode. I have implemented a CGenericListCtrl (derived from CListCtrl) that contains common functionality used in all those list views. All the list views used in my applicatons are derived from CGenericListCtrl. What I am trying to do is basically impement the sorting functionality based upon the type of the columns. For example some columns could be numeric whereas other could be string or date type. In the CGenericListCtrl I have implemnted a Compare function that apply the sorting algorithm depending upon type of the column. So Let's say I have a class CMYFirstListCtrl that is derived from CGenericListCtrl. In CMYFirstListCtrl at the time of creation of columns I also have an array that contains the type of data stored in each column ( via some enumns). What I am trying to do is that when user click on CMYFirstListCtrl header for sorting, I need to pass the column type enum to Compare method of CGenericListCtrl. Can anyone please help me how can I pass this info from a derived class to its parent though some sort of notification?
|
|
|
|
|
Hi
I am not sure if I have understood your problem!!!
What I think is that you can implement the funtionality for parent class instead of derive class, so that the parent class funtion can directly be called. this may not help you lot...
other method you may use "super" to get parent class methods and variable.
|
|
|
|
|
There is no keyword super in C++. It's available only in Java.
I am not seeing any problem whatsoever using the Sort function of the Base class. Just call the method Sort(...) and pass the parameters. As long as the Sort method is not virtual, you will always end-up in the Base class method.
Alternatively you can think of making Sort(...) method static as long as it is not refering any class memebers and you are passing all the values in the parameter list. You can invoke the method using CGenericListCtrl::Sort(...)
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
Thanks for the response guys. Problem is that OnColumnClick is invoked from the dervied class and during that event I am not sure how can I pass this additional variable containing type of the header. Is there any lParam type of thing that I use to fill in this info? Thanks
|
|
|
|
|
I was browsing through the site a few weeks ago, and came a cross a simple http client that would run from a command line in the command prompt. I have tried searching again for it to no avail.. do projects sometimes get taken off of this site? If not, does anyone know which one I am talking about, and maybe provide a link?
|
|
|
|
|
conrad10781 wrote: do projects sometimes get taken off of this site?
Occasionally, authors request that their articles are removed, so yes. Also, sometimes articles are moved between categories.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I'm clueless about using the IHTMLDocument2 interface. How do I use it to load a url or a html document? What about IDispatch Interface, do I need to use it?
|
|
|
|
|