|
fred shaw wrote: However, if I remap a drive with the same letter to a different server, the windows explorer label is not updated. It displays the old server name.
What happens if you try and access that server? Does WE try the older server or the new one?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
It accesses the new server, however the old server name is being displayed which is wrong since it is pointing to the new server.
Fred Shaw
|
|
|
|
|
I have subclassed a few controls (the win32 method not MFC) and am now trying to prevent flickering while the control is being moved around the main window. Basically, all I want to do is prevent the control from painting itself while the main window is being resized. I am able to trap the WM_MOVE message, but unable to trap the WM_ENTERSIZEMOVE or WM_EXITSIZEMOVE messages. I'm guessing these are only sent to the top level window. Can anybody suggest an alternative to determining when a control starts moving and ends moving?
|
|
|
|
|
It sounds like the entire client area of the background window is being repainted every time
a WM_PAINT occurs.
In the window's WM_PAINT handler if you are not using BeginPaint() you can make a clipping
region to only draw the newly exposed part of the window using GetUpdateRect (make sure you
validate the rect with ValidateRect() so you don't get repeated WM_PAINT messages for the same
rect).
Or maybe it's happening in a WM_ERASEBKGND handler in the window or control
Mark
|
|
|
|
|
Mark Salsbery wrote: Or maybe it's happening in a WM_ERASEBKGND handler in the window or control
Both the main window and the control have a bitmap skin applied to them. For the main window, each time it is resized I must rebuild the bitmap used for the skin and repaint it to the window. This is naturaly done in the WM_ERASEBKGND handler.
I will have a play with the clipping region and see if I can better the performance a little.
A simple hack I came up with is to draw the child controls image to the main windows image. The flickering is still there, but cannot be seen.
|
|
|
|
|
Does using the WS_CLIPCHILDREN style on the main window help at all?
|
|
|
|
|
I have to access tables from MicroSoft Access and read write its contents.
|
|
|
|
|
sujeet_kulk wrote: I have to access tables from MicroSoft Access and read write its contents.
OK? What specifically did you want to know?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I have to change(/read) data in Microsoft Access Tables (data base tables) through Automation( using object model of MS Access (not through ODBC)) in MFC.
|
|
|
|
|
sujeet_kulk wrote: I have to change(/read) data in Microsoft Access Tables (data base tables) through Automation( using object model of MS Access (not through ODBC)) in MFC.
I got that much from your initial post. What you are asking, however, is very broad. It can't be answered in a simple post.
Do you need to add Access' type library to your project?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
No I have added that, atleast name the classes and methods involved and sequence if possible.
|
|
|
|
|
sujeet_kulk wrote: ...name the classes and methods involved...
They are in the .h and .cpp files that were added to your project. The first one you'll need is _Application . Call its CreateDispatch() method.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Fine with that but how to get the rows and columns of a datatable, I mean which are the classes.
|
|
|
|
|
sujeet_kulk wrote: ...which are the classes.
Have you looked at AccessObject ?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,
I want to compress the video data using XviD codec. How I can set this codec as default codec for compression in "AVISaveOptions" API which displays a dialog box to user. I don't want to show that dialog box but instead it should use the default codec from. How can set the default codec value?
Regards,
Hemant.
|
|
|
|
|
I have following line of code:
if(a==Z||<br />
b==Z||<br />
c==Z||<br />
d==Z||<br />
e==Z||<br />
f==Z||<br />
g==Z)<br />
{<br />
.<br />
.<br />
.<br />
} can this be written in a better way ?
p.s all the variables are of type enums
|
|
|
|
|
How about:
if (a <= Z && Z <= g)
... Of course, trying to one-up the optimizer is usually a lost cause.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Is Z a enumeration value or a variable? If they are all variables, you really can't do much without making assumptions about ordering for the values.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Can Somebody help me..
i have one ListBox and one combobox . i want that when user select any item in the ListBox , the path of that item is got selected in the combobox..
How to achieve this..
Please help me in this..
Thanks and Regards
|
|
|
|
|
step1:
In the ui designer, right click the control (combobox) and
click 'wizard'.
You can add an event to it.
Then, an event function will be created in the classes you chose.
step2:
Add code in the event function.
Something like this->GetDlgText(...)
|
|
|
|
|
You need to insert this item to ComboBox withAddString and use of
<br />
SetCurlSel
|
|
|
|
|
Shikha Jain wrote: How to achieve this..
Are you handling the LBN_SELCHANGE notification?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
this is an continuous message...
Below is the client code to receive 2 replies from a server:
/*********/
BOOL streamclient(char* ip, unsigned short port, char* message, AString* astr_reply)
{
//
// Create a TCP/IP stream socket
//
SOCKET theSocket;
theSocket=socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
if(theSocket==INVALID_SOCKET)
{
eprintf("ServerHandler:streamclient()\nsocket() %s %u", ip, port);
return FALSE;
}
//
// Fill in the address structure
//
SOCKADDR_IN saServer;
DWORD dwIPAddr=inet_addr(ip);
saServer.sin_family=AF_INET;
saServer.sin_addr.s_addr=*((u_long FAR*)((char*)&dwIPAddr));
saServer.sin_port=htons(port);
//
// connect to the server
//
int nRet;
nRet=connect(theSocket, // Socket
(LPSOCKADDR)&saServer, // Server address
sizeof(struct sockaddr));// Length of server address structure
if(nRet==SOCKET_ERROR)
{
closesocket(theSocket);
eprintf("ServerHandler:streamclient()\nconnect() %s %u", ip, port);
return FALSE;
}
//
// Send data to the server
//
nRet=send(theSocket, // Connected socket
message, // Data buffer
(int)strlen(message), // Length of data
0); // Flags
if(nRet==SOCKET_ERROR)
{
closesocket(theSocket);
eprintf("ServerHandler:streamclient()\nsend() %s %u", ip, port);
return FALSE;
}
aprintf("sent to CATOS (%s %u):\n%s", ip, port, message);
//
// Wait for a reply
//
char* szBuf;
AString astr;
/* receive ACK */
szBuf=(char*)malloc(sizeof(char)*(CATOS_BUFFER_SIZE+1));
if(szBuf==NULL)
{
eprintf("ServerHandler:streamclient()\nszBuf==NULL");
return FALSE;
}
nRet=recv(theSocket, // Connected socket
szBuf, // Receive buffer
CATOS_BUFFER_SIZE,//sizeof(szBuf), // Size of receive buffer
0); // Flags
if(nRet==SOCKET_ERROR)
{
closesocket(theSocket);
free(szBuf);
eprintf("ServerHandler:streamclient()\nrecv() %s %u", ip, port);
return FALSE;
}
if(astr.Set(szBuf))
aprintf("received from server:\n%s", astr.SubString(0, ETX, TRUE));
else
aprintf("received from server:\n[ACK]");
/* receive useful reply */
// clear szBuf and wait for a while so that recv() becomes ready:
for(int i=0; i<catos_buffer_size; i++)
="" szbuf[i]="\0" ;
="" sleep(second_receive_delay);
="" nret="recv(theSocket," connected="" socket
="" szbuf,="" receive="" buffer
="" catos_buffer_size,="" sizeof(szbuf),="" size="" of="" 0);="" flags
="" if(nret="=SOCKET_ERROR)
" {
="" closesocket(thesocket);
="" free(szbuf);
="" eprintf("serverhandler:streamclient()\nrecv()="" %s="" %u",="" ip,="" port);
="" aprintf("serverhandler:streamclient()\nrecv()="" port);return="" false;
="" }
="" if(astr_reply-="">Set(szBuf, nRet))
{
//
// Display the received data
//
free(szBuf);
closesocket(theSocket);
aprintf("received from server:\n%s", astr_reply->Value);
/* exception */
return TRUE;
}
aprintf("received from server:\n[useful reply]");
free(szBuf);
closesocket(theSocket);
return FALSE;
}
BOOL ServerHandler::Send(char* ip, unsigned short port, char* message)
{
WORD wVersionRequested;
WSADATA wsaData;
int nRet;
int i;
wVersionRequested=MAKEWORD(1,1);
nRet=WSAStartup(wVersionRequested, &wsaData);
if(wsaData.wVersion==wVersionRequested)
{
for(i=0; i
|
|
|
|
|
hi,
is it showing exception which executing aprintf statement or after returning from aprintf statement
mpk1979
|
|
|
|
|
If a printf("aprintf OK"); is added after calling aprintf,
the message "aprintf OK" can be shown.
then goes to return TRUE;
But printf("returned") if added in the lower function, it does not show "returned".
So, I think something causes the exception for exiting the upper function.
Please advise.
|
|
|
|