|
Thank you PJ Arends for your kind cooperation.
I've used VC++6 but I've not found WM_UNICHAR defined in anyone of windows.h, winbase.h and winuser.h files. not even after the if statement that u mentioned
in fact I could not find any line like
#if(_WIN32_WINNT >= 0x0501) ..but i found serveral conditions like
#if (_WIN32_WINNT >=0x0500) or #if(_WIN32_WINNT >=0x0400) like this...but nowhere i've seen WM_UNICHAR, ...Could you please suggest me what should I do in this circumstances??
A Programmer of New Horizon
|
|
|
|
|
|
Thank you Alok, But still it doesn't work...still i'm getting the same error message: WM_UNICHAR undeclared!!!
A Programmer of New Horizon
|
|
|
|
|
|
Hi,
I have a program which consists of a exe and a dll (there are some additional static librarys). Well, everything is ok - until I press F5 to start the app. Visual C++ then will ALWAYS recompile the whole program, even if I made no changes at all! What I think is also very strange, is that when I make a few changes in a resource that is in the dll (for example remove some controls from a dialog) the old dialog is shown when starting the program. There are some other weird things with resources but I think all these problems are somehow connected...
does somebody know this problems and how to solve them? the project is a normal win32 application + win32 dll. I don't use MFC, instead I'm using win32gui lib, but I think that won't be the reason for this strange compilation behaviour...
my IDE is vc.net 2003 with the toolkit 2003. btw i tried a complete rebuild of the whole app but the problem persisted
mfg steven
|
|
|
|
|
It sounds like the copy of the DLL in the EXE's compiler output directory is out of date. Unlike the VB and C# compilers, the C++ compiler/project system does not copy dependencies into target directories.
I normally set up the build process so that the binaries are output into the same directory - if you created a folder for the solution, the project's Output Directory could be set to '../Debug', which would create a Debug folder under the solution's folder (i.e. a sibling of the projects' folders). You should instruct the linker to find the DLL's import library in this directory: include e.g. '../Debug' in the Additional Libraries under Linker > General in Project Properties for the EXE project. You should also ensure that your dependencies (in Project > Project Dependencies) are set up correctly: the EXE project should depend on the DLL project.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
first thanks for your reply!
but the output directories are ok and so are also the dependencies. that was also my first thought when i discovered the problems...do you have some other suggestions?
|
|
|
|
|
fotzor wrote:
Visual C++ then will ALWAYS recompile the whole program, even if I made no changes at all!
That's usually caused by one of your header files having its modified date in the future.
--Mike--
LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD
|
|
|
|
|
thank you, that helped! it doesn't recompile now everytime. some days before i changed the system time - and i edited the source files with the new time. i then changed the date back...
but i'm still having trouble: i mentioned that changes in resources have no effect. do you also have some ideas for that?
|
|
|
|
|
don't mind - after some trying i found out what has happened. because i massively experimented with the settings i accidentally removed the dependencies of the exe to the dll - and so the new dll wasn't created...now it works
|
|
|
|
|
Hi all,
I need to develop a multy-cast server which accept connection from several
clients(each client at different port).
The problem is that after the clinet connect to my server,and send data at the first time,in the next time,from some reason - the select()
function is blocking my application,until the client will connect again(which means that the client needs to connect each time he want to send data).
I was told to use non blocking socket,but it's not working.
Here is my listening thread:
UINT ListeningThread(LPVOID lpvoid)
{
CMultycast_serverDlg *dlg = (CMultycast_serverDlg *)lpvoid;
FD_SET SocketSet;
int port;
struct sockaddr_in echoClntAddr;
SOCKET clntSock;
unsigned int clntLen;
int SelectResult = 0;
unsigned long argp = 1;
dlg->SelectFlag = false;
dlg->ExitFlag = false;
FD_ZERO(&SocketSet);
for(port = 0 ; port < dlg->NumberOfPorts ; port++)
FD_SET((unsigned int)dlg->SocketsArray[port] , &SocketSet);
while(!dlg->ExitFlag)
{
SelectResult = select(NULL , &SocketSet , NULL , NULL , NULL);
if(SelectResult == 0)
continue;
else if(SelectResult == SOCKET_ERROR)
{
AfxMessageBox("Error : select() has failed ");
return 0 ;
}
else
{
for(port = 0 ; port < dlg->NumberOfPorts ; port++)
{
if(FD_ISSET(dlg->SocketsArray[port] , &SocketSet))
{
clntLen = sizeof(echoClntAddr);
clntSock=accept(dlg->SocketsArray[port] , (struct sockaddr*)&echoClntAddr , (int *)&clntLen);
if(clntSock != INVALID_SOCKET)
{
dlg->HandleClient(clntSock);
dlg->m_RecievedDataListBox.AddString(dlg->RecievedString);
ioctlsocket(clntSock , FIONBIO , &argp);
}
}
}
}
}
for(port = 0 ; port < dlg->NumberOfPorts ; port++)
closesocket(dlg->SocketsArray[port]);
return 1;
}
Can anyone please help me???
With best regards,
Eli
|
|
|
|
|
I am writing an application in which I want to also control the power of the PC (running Win98 - only). According to a know schedule, I want it to enter Standby and later on to wake up. What functions are available to a C++ program to achieve this power control ? (Apologies if this is not STRICTLY the correct forum for this query !)
Doug
|
|
|
|
|
|
Can I creat a CDialog object in a CPropetyPage ???
I have an application with property sheet-pages objects (tab-dialog). I have a dialog object (and match implemented class) which I want to add to the sheet as a page in it. I create a class derived from CPorpertyPage and add it to the sheet and in it I creat the dialog.
Is this ok ? It seems that I have a problem entering data to edit boxes because of this ? what can I do ?
thanks in advance,
yaron.
|
|
|
|
|
Yaron Abershitz wrote:
I have a dialog object (and match implemented class) which I want to add to the sheet as a page in it. I create a class derived from CPorpertyPage and add it to the sheet and in it I creat the dialog
The Simple Way to do this is ..
1 ) Create A Dialog Resource and put all the controls u need
2 ) double click the dialog then the they will ask for creating a class
3) When creating the class , choose the parent as CPropertyPage
4) Add this Page as a member variable in your Property Sheet Class
5) In the constructor of PropertySheet, Call AddPage(& Page); inorder to include this page in your sheet
6) DoModal()/ create Your PropertySheet Object , then the page u added earlier will appear as a page in that sheet.
try this...
Ninety-eight percent of the thrill comes from knowing that the thing you designed works, and works almost the way you expected it would. If that happens, part of you is in that machine.
|
|
|
|
|
Hi All
I know little about Visual C++.net programming and would be grateful for any insights into solving the following problem. For one function, ideally I would like a Switch Case that has 10000 case entries as follows:
Switch (Product_Case)<br />
{<br />
Case 1 : Price = 1.07; break;<br />
Case 2 : Price = 1.07; break;<br />
...<br />
Default Case<br />
}
Using a Switch case in this way would achieve my aim of being able to get a price corresponding to a product, but presumably a 10000 case switch would cause memory problems and and be slow. How would an experienced programmer handle this? Would they create an .mdb with the Product and corresponding Price entries and then read from that file using pointers and SQL? As I want this data embedded in an .XLL, what type of header/source/resource do I use in Visual C++.net?
Any ideas would be gratefully accepted.
Jeremy
|
|
|
|
|
I would just do binary or plaintext file, put in resource, when needed load to memory and do something like Price=MemArray[index].
Igor Green
http://www.grigsoft.com/
Compare It! + Synchronize It! - files and folders comparison never was easier!
|
|
|
|
|
I don't think it would be particularly slow, actually, but the code would be really large. The compiler is likely to build a jump table rather than a sequence of if/else tests.
As to how to implement it, it depends whether the data will change over time, and if so, whether you want to allow an administrator to make the changes (in which case some form of external file access is in order). If you think the data is fixed for all time, or if a recompile is acceptable to change the values, I'd create a lookup table. Since it's 10000 values I'd probably write a program to generate the C++ file containing the lookup table! Obviously if you do this it's harder to change values, but on the other hand you won't need to write file handling and validation code, nor have to handle situations where the file is not present or inaccessible.
If you decide to go the external data route, I'd go with a file that fits in with the existing data access and the expected skill of the administrator. If data already comes from a SQL or Jet database, I'd place it there. If it's a flat file, I'd add this as an extra flat file, and so on.
Finally, if the quantity can be computed from some equation, I'd just do the computation rather than the lookup. A few years ago I might have cached the values of computations, or used lookup tables. Now processors are so much faster than RAM that computing most quantities is often quicker than retrieving a precomputed value. Obviously you need to measure this with a profiling tool.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
I recommend using a Product_Case to Price map.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
You still have to get the valuess INTO the map, so how does that provide any gains over the switch statement? Especially if the switch compiles into a jump table and not a series of if/else if type statements. However, I would accept that a MAP might be the way to go if reading of an external data source is implemented.
|
|
|
|
|
Blake Miller wrote:
You still have to get the valuess INTO the map, so how does that provide any gains over the switch statement?
The gains are in the area of maintenance, not necessarily performance.
- For large
switch statements a map lookup is easier to understand and therefore easier to maintain.
- A map lookup is more robust (i.e. less error-prone, dure to factoring) if the switch is needed more than once.
- As you have already pointed out, a map allows run-time initialization and is therefore more flexible.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hey.
I dont know where this topic should be...
I am looking for a SIMPLE description of jabber protocol.
|
|
|
|
|
|
hi ,
I want to use command line by using GetCommandLine but:
When I run my app like this:
MyApp.exe /run then get an error.
Why?
Thanks.
|
|
|
|
|
but man how are you running your application I mean what parameter is it run by.
You shoul write a registry key for this. I have a program on code project that uses this function GetCommandLine ("Little Audio Player" by euacela)
you can easily see there how to use getcommandline function. the program uses it to load a playlist just like winamp. Just by clicking on the playlist the program starts up and loads it.
gabby
|
|
|
|