|
manish rastogi wrote: But if 'Obtain ip address automatically' settings is on, this function gives some different ip.
Which is the whole essence of DHCP. The gethostbyname() function does not care how your computer obtained its IP address.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
I am using a grid view in a mulitdoc application.while horizontal scrolling the titles of the grid is not updating.But the data in the grid is updating.
Is there is any method to refresh or repaint.
thanks in advance
Deepu
|
|
|
|
|
Hello all,
I am currently doing my FYP. I download a set of header files of libxml2 with .h files and .lib files.
I first try to create a windows 32 application console application and it works fine (to ensure i link it properly)
I then head off and try to create a DLLs for the smart device, however, i return with the following errors:
Linking...
1> Creating library Windows Mobile 6 Professional SDK (ARMV4I)\Debug/TESTTESTTEST.lib and object Windows Mobile 6 Professional SDK (ARMV4I)\Debug/TESTTESTTEST.exp
1>TESTTESTTEST.obj : error LNK2019: unresolved external symbol xmlParseFile referenced in function ExportedFunction
1>Windows Mobile 6 Professional SDK (ARMV4I)\Debug/TESTTESTTEST.dll : fatal error LNK1120: 1 unresolved externals
1>Build log was saved at "file://c:\Documents and Settings\wu\My Documents\Visual Studio 2005\Projects\TESTTESTTEST\TESTTESTTEST\Windows Mobile 6 Professional SDK (ARMV4I)\Debug\BuildLog.htm"
1>TESTTESTTEST - 2 error(s), 1 warning(s)
I created my DLL like this:
#include "resourceppc.h"
#include "stdio.h"
#include "string.h"
#include "stdlib.h"
#include "xmlmemory.h"
#include "parser.h"
extern "C" void EXPORT ExportedFunction(){
char * docname = "abc";
xmlDocPtr doc;
xmlNodePtr cur;
doc = xmlParseFile(docname);
}
Being noob, i just want to know:
1. It is possible to create a DLL using .lib files ?
2. Is my linking wrong ?
Any help of somekind will be greatly appreciated !
Thanks,
Leslie
|
|
|
|
|
I think the issue is that you've downloaded an x86 Win32 implementation of libxml2. You're then trying to link that into a Windows Mobile DLL that's targetting an ARM processor. Now, ARM != x86, so you're going to have to find some ARM Win32 binaries from somewhere - that probably means building it from source yourself...
What;s wrong with using Microsoft's XML libraries? Aren't they bundled with Windows Mobile? If so, that'd be simpler than trying to install libxml2...
|
|
|
|
|
One other XML alternative (from this very site!) - PugXML[^] - it's lightweight and simple to build!!!
|
|
|
|
|
Hi Stuart,
Thank you for your answer first.
I know you must be wondering why we don't use the integrated XML, but it is my supervisor request (OMG ~). We are trying to build a common engine that is written in plain C and is fully operational in iphone and windows mobile environment.
Do you have any idea if there is any avaliable library avaliable ? If so, very appreicated if you could just post the link !
Thanks,
Leslie
|
|
|
|
|
leslie wu wrote: We are trying to build a common engine that is written in plain C and is fully operational in iphone and windows mobile environment
libxml would be the best choice in my opinion, it is widely used in non-Microsoft commercial products. You should compile the libxml library from source rather than using the pre-compiled libraries. Although commonly used... the designation 'Win32' is somewhat a misnomer by being an incomplete description. It would more accurate if defined as 'Win32-x86'.
Best Wishes,
-David Delaune
|
|
|
|
|
As Randor says - libxml, and it looks like you're building it from sources...see this page[^] for download links! Good luck!
|
|
|
|
|
Being a Noob, I just want to ask 2 more questions:
1.I have download all the header and the C files associated with the library. If I ever want to build a DLL, I only need to call the header ? (e.g. I call xmlmemory.h for the "parseDoc" function ??) Do I have to compiled all the C files and the header into a static library first ?
2. When I did iphone development, I notice that there is already a compiled .lib files in the path /usr/bin/lib (if i remember the path correctly =P ). Could I copy the .lib file ? I notice that iphone and windows mobile both use the ARMV4 processor...so the architecture should bethe same ?
Thanks,
Leslie
|
|
|
|
|
leslie wu wrote: If I ever want to build a DLL, I only need to call the header ? (e.g. I call xmlmemory.h for the "parseDoc" function ??) Do I have to compiled all the C files and the header into a static library first ?
You need to have compiled the C files into a library - either a static library (a .lib file), or a dynamic library (a .dll file) with associated import library (also a .lib file). You can link against either .lib file, but if you link against the dynamic library version, you need to deploy the .dll file with your project.
leslie wu wrote: When I did iphone development, I notice that there is already a compiled .lib files in the path /usr/bin/lib (if i remember the path correctly =P ). Could I copy the .lib file ? I notice that iphone and windows mobile both use the ARMV4 processor...so the architecture should bethe same ?
The processor is the same, but the operating system is (very) different - you cannot use iPhone binaries on the Windows Mobile platform, as it will expect to be able to call OS X.
|
|
|
|
|
Another XML library you might want to consider is Expat[^], if only because it has a Visual Studio 6 project file in the source distribution that you could use as a starting point for building it for the Windows Mobile target - you'd need to change the project's target from x86 Win32 to the correct one for your WIndows Mobile target, but that should be relatively trivial.
|
|
|
|
|
So I'm trying to create a function that will layer all of the objects I have in the list onto a temp HDC and then BitBlt from it to the actual HDC which is passed in as hdc. If I replace the line BitBlt-ing everything to the hdcTempMem with the same statement BitBlt-ing to hdc I can see it working.
Not sure what needs to be done to get this intermedte hdc to work but it will be needed because otherwise there will be flashing when running at full speed. Anyone able to help me out?
void UpdateDisplay(HWND hwnd, HDC hdc)
{
HBITMAP oldImg;
RECT screenRect;
HINSTANCE hInst = NULL;
HDC hdcTempMem, hdcMainMem;
AniObject curObj;
int i = 0;
GetClientRect(hwnd, &screenRect);
hdcMainMem = CreateCompatibleDC(hdc);
for(objI = objects.begin(); objI != objects.end(); objI++)
{
if(objI->objectType == ANIBITMAP)
{
GetObject(objI->hBmp, sizeof(BITMAP), &(objI->bmp));
hdcTempMem = CreateCompatibleDC(hdcMainMem);
oldImg = (HBITMAP)SelectObject(hdcTempMem, objI->hBmp);
BitBlt(hdcMainMem, objI->posX, objI->posY, objI->width, objI->height, hdcTempMem, 0, 0, SRCCOPY);
DeleteDC(hdcTempMem);
}
i++;
}
BitBlt(hdc, 0, 0, screenRect.right, screenRect.bottom, hdcMainMem, 0, 0, SRCCOPY);
DeleteDC(hdcMainMem);
|
|
|
|
|
What happens if you alter this line:
hdcTempMem = CreateCompatibleDC(hdcMainMem);
to
hdcTempMem = CreateCompatibleDC(hdc); ?
Also - have you checked to see if the BitBlt operation is returning an error status or not?
Also - looking at the CreateCompatibleDC[^] documentation, it seems to me that you should be selecting a bitmap into hdcMainMem that you can draw on - otherwise (again, from what the documentation says) you only have a one pixel bitmap backing hdcMainMem . That seems to be backed up when I look at the double-buffering DC class documented here[^]. OK, it's for WTL, but it uses the standard GDI operations to implement the double-buffering.
|
|
|
|
|
Thanks a lot for spotting my error. It was your last point about the one pixel bitmap that was the problem. I forgot to give hdcMainMem an area to draw on. Everything worked once I added:
blankImg = CreateCompatibleBitmap(hdc, screenRect.right, screenRect.bottom);
SelectObject(hdcMainMem, blankImg);
Now I can get back to work. I think thats a good thing?....
|
|
|
|
|
your hdcMainMem needs a bitmap
Greetings from Germany
|
|
|
|
|
I want to use c language function localtime() for the conversion of seconds into date.
As I have learned from someone that this function used the date 1970-01-01 00:00:00 as the base to calculate seconds into date. But when I used it it seems that it use the base date as 1970-01-01 05:00:00. I can't understand this.
Also is it possible to calculate the date from seconds by using someother base date value. for example i have seconds starting from 1994-01-01 00:00:00 to now, then how to calculate the time from these seconds (base date + seconds).
The function used by me is as follows.
void Duration_to_time(int Seconds,char OutputTime[])
{
time_t count_second;
struct tm *newtime;
tzset();
count_second=Seconds;
newtime = localtime(&count_second);
if (strftime(OutputTime, 20, "%Y-%m-%d %H:%M:%S", newtime) == (size_t) 0)
printf("Could not get string from strftime()\n");
}
|
|
|
|
|
Umer Aziz wrote: As I have learned from someone that this function used the date 1970-01-01 00:00:00 as the base to calculate seconds into date. But when I used it it seems that it use the base date as 1970-01-01 05:00:00. I can't understand this.
localtime adjusts the evaluated time to your local one (hence the five hours shift). use gmtime , instead.
Umer Aziz wrote: Also is it possible to calculate the date from seconds by using someother base date value. for example i have seconds starting from 1994-01-01 00:00:00 to now, then how to calculate the time from these seconds (base date + seconds).
To use 1994-01-01 00:00:00 as base date, simply add the corrensponding time_t value to your duration and then call gmtime and strftime )
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]
|
|
|
|
|
Umer Aziz wrote: As I have learned from someone that this function used the date 1970-01-01 00:00:00 as the base to calculate seconds...
It actually goes back about 21600 seconds beyond that to 31-Dec-1969 @ 1800.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Thanks a lot for your prompt response
|
|
|
|
|
Hi,
I developing an application which stores the file paths and also i have a shell extension dll.i wanted to send a file path from a shell extension dll to an application through a registered windows message. is it possible.?
Jose Jo Martin
http://www.simpletools.co.in
|
|
|
|
|
Check out WM_COPYDATA[^], it sounds like that is just what you need.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Sutter and Alexandrescu have a section on proper use of C++ exceptions that strongly encourages the use of C++ exceptions. I am confused by the last item, number 75, where they suggest avoiding exception specifications.
1) If you do not throw, then why bother trying to catch, which is what the previous items advocate?
2) If exception specifications are bad why does C++ support them?
Can someone please explain what I am missing?
Thanks
|
|
|
|
|
Member 2603772 wrote: If you do not throw, then why bother trying to catch, which is what the previous items advocate?
Not using exception specifications doesn't mean you are guaranteeing that your code doesn't throw an exception - it's the reverse of that - you are making no guarantees about whether your code throws exceptions or not. If a piece of code you're calling has no exception specification, assume that it may throw *any* exception. Only handle exceptions if there's some action you can perform that fixes what caused the exception. Any other exception should be allowed to terminate the application - if you don't know how to fix what caused the exception, then you've got problems.
Member 2603772 wrote: If exception specifications are bad why does C++ support them?
They're not bad per se. The point is that C++ doesn't enforce them or (really) take any notice of them. That means that compilers won't verify that they're correct, so they're liable (like code comments) to become inaccurate as you change the code they describe, because you probably won't remember to change the exception specification.
This article[^] by Herb Sutter may help to make his view on exception specifications clearer?
|
|
|
|
|
Maybe this article[^] helps you understand the exception specifications and why they are not a good idea.
|
|
|
|
|
Dear All,
I just started to use MFC library together with Visual Studio 2008 to wrap around my
mathematical engine which I build as a console application.
I hope my question will be easy to answer. I have CListBox object which I fill time to time with error messages in catch block:
....
catch (std::exception& ex)
{
std::string str = ex.what();
m_List.AddString(str.c_str() );
}
....
Sometimes, error messages are longer then physical width of CListBox object and as a result truncated.
As far as I see, CListBox object does not have property in "Property list" to explicitly specify string/word wrapping. There are few properties such as "Multicolumn", "Horizontal Scroll", "Disable No Scroll" which does not help me to make it possible to view all length of error messages.
I am sure it must be easy way to do it. I hope someone will have some suggestions/comments about it issue.
Thank you in advance,
nuclph.
|
|
|
|