|
I have a strange problem. On my computer and several others, with the screen resolution at the SAME setting, the actual display area size seems to be different. My computer is an English version. The other computers most of the time is another language version. There seems to be on the other computer to have a slightly BIGGER display area.
Has anyone else met this issue? Where does it come from and how to resolve it?
THanks in advance.
|
|
|
|
|
is it a bigger monitor ?
Seriously, how do you know it's bigger, and by how much ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Well, the actual size will vary but each support different resolutions and can be set. I have seen where two monitors with the same setting (lets say 1280x1024), my program on one (like my laptop using Win200 Eng) will be fine. On the other one with also the same resolution (as set from Windows), it will display with an extra space at the bottom of my CFormView view. I placed my controls according to the screen on my laptop so I can see a VERY distinct extra spacing (in one almost 1 inch) where my controls are not in the other monitor. This is even though the display resolution is supposedly set the same. I am not sure this comes about due to different language versions or what.
Any ideas or perhaps even seen this problem?
Thanks.
|
|
|
|
|
The display area will be the same. The size of the fonts will make a difference to how your dialog box is layed out. All the controls in your form view will be scaled according to the size of the font (since they are designed in dialog box units), so if the font is bigger, it will appear like there is less room on the display. If you query the size of your window, however, it should remain the same.
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"
|
|
|
|
|
Hi
I am writing a Regular DLL in which i am creating a Thread by using the function
extern "C" __declspec(dllexport) BOOL ReadCard(char *pData)
{
if(l_hPort == NULL)
{
strcpy(pData,"COM port is null");
return FALSE;
}
memset(g_strResult,0x00,500);
//PrepareThread(pData);
g_hThreadRead = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) MyMSR_PortReadThreadMgr,(LPVOID)&pData, 0,&dwThreadID);
}
I have declared the function at the top but when i call this DLL from some other application it is working fine but it is not going to the function i have in CreateThread means it is not going on the function MyMSR_PortReadThreadMgr();
Please tell me whats wrong with this.
I have created the project using Regular DlL in which i have inserted one file PrintPad.cpp and PrintPad.h in which i am writing these functions.
My Function is as:
static UINT MyMSR_PortReadThreadMgr(LPVOID pData)
{
BOOL bSuccess = TRUE;
while(1)
{
if ( l_bTaskAbort )
{
Disconnect();
return(FALSE);
}
// if the card is removed then read the data
if( !GetCardData())
{
strcpy((char*)pData,"No Data Received");
Rs232CleanUp(FALSE);
return FALSE;
}
if(strncmp(g_strResult,"{N}",3) == 0)
{
//strcpy(pData,"No Data Received.");
Rs232CleanUp(FALSE);
return FALSE;
}
if(strstr(g_strResult, "T1:B") || strstr(g_strResult, "T2:B") || strstr(g_strResult, "T3:B"))
{
// strcpy(pData,"bad track Read");
Rs232CleanUp(FALSE);
return FALSE;
}
}// end of while
return bSuccess;
}
|
|
|
|
|
I think you should test the return values of "CreateThread".
GOOD LUCK.
|
|
|
|
|
it is creating the thread but not going to the function??
Can you tell me the reason..
shailesh
|
|
|
|
|
--------------------------------------------------------------------------------
Hi,
I want to change the BMP from the picture control once I press a button. It seemed like I have to press twice on the button to change first time and then it never changes.
Here is the code:
BOOL CSdsdDlg::OnInitDialog()
{
CDialog::OnInitDialog();
HBITMAP hBmp1 = (HBITMAP ) ::LoadImage(NULL, _T("c:\\1.bmp"), IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
m_pic.SetBitmap(hBmp1);
...............
}
void CSdsdDlg::OnButton1()
{
HBITMAP hBmp2 = (HBITMAP ) ::LoadImage(NULL, _T("c:\\cool.bmp"), IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
if (m_pic.GetBitmap()== hBmp1)
m_pic.SetBitmap(hBmp2);
else
m_pic.SetBitmap(hBmp1);
return;
}
|
|
|
|
|
What is the return values of "m_pic.GetBitmap()"?
Perhaps the problem is in "m_pic.SetBitmap(XXX).
You don't set the correct flag.
|
|
|
|
|
You're better off keeping a class member variable specifying which bitmap is currently displayed, as GetBitmap() may not necessarily return the same handle that you give it, although it probably will.
Also, you're comparing against hBmp1 in OnButton1() , but in OnInitDialog() , hBmp1 is a local variable. There must be another definition somewhere that is causing the code to work unexpectedly.
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"
|
|
|
|
|
When I attempt to create a MSFlexGrid within OnCreate(...) of my derived COleControl I get a memory access violation. (Compiles Find)
This is what I tried:
CMSFlexGrid m_MyGrid; //In Header
m_MyGrid.Create(NULL, "Grid", WS_VISIBLE, CRect(0,0, 400,300), this, IDC_GRID_MAIN); //In OnCreate(...)
Thanks.
|
|
|
|
|
I have an application where using a timer I periodically check to see if a client is trying to connect over a socket to a server...the server code uses the Accept() call to accept new clients, but I dont want the call to Accept() to block if no one is attempting to connect. I want to immediately execute some other code. Can I make it non blocking??
Thanks.
Jerry
|
|
|
|
|
I think you may instead want to call Listen() in a separate thread. Listen() is a blocking call (I believe you can specify a timeout) that waits for a client to connect. Accept() is called when the connection is accepted.
See this[^] MSDN link.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Ravi Bhavnani wrote:
Listen() is a blocking call (I believe you can specify a timeout) that waits for a client to connect. Accept() is called when the connection is accepted.
Actually, Listen() simply sets up the socket for accepting connections, and accepts the size of the connection backlog (how many connections can be queued before they are accepted using Accept() ). Accept() is a blocking call that waits for a connection, and accepts it when one arrives.
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 think you should go by select() then. It takes a parameter which specifies a timeout for the operation. You can also check out the WSAAccept() function.
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
|
|
|
|
|
For anyone learning Windows Sockets development:
http://www.sockets.com/[^]
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
or if you don't worry about win9x stuff, you can look here around for some articles about IOCP.
|
|
|
|
|
I've been programming in MFC for some time now, but have not needed to do much with the "control bar" classes until recently.
My problem is, I would like to have a control bar (toolbar, rebar, dialogbar, i-don't-care-which-bar) with a combobox whose contents is added at runtime (from a database, for example).
I've coded up a toolbar that draws a combobox overtop a seperator, but that's very klunky. I tried using a dialog bar, but since its not CDialog derived, one cannot easially add a control instance to one's app and initialize the combobox in the traditional manner. And of course, a rebar seems only to take a toolbar, dialogbar, or (I think) individual controls, but I want multiple controls on a bar/band.
It seems the the controlbar functionality is made more for sending simple messages to one's app, rather than manipulating more complex data. Is there are a simple solution to this problem that I'm overlooking? Thanks for your help.
-Jesse
|
|
|
|
|
I have a windows application that made by someelse. I don't have the source to change it. It takes kb/mouse inputs and does some work. Therefore, I wish I could use a program to pretend the kb/mouse sending inputs to it, so that it could running automatically.
If the target application is running foreground, everything could be easy. Using any keyboard/mouse record & play software will satisfy me. But I wish it could be running background. So I can use forground (another active windows) to do something else, for example monitor.
So, the problem is how to pretend kb/mouse and send message to a BACKGROUND app. For example, how to send "hello" to a un-active Notepad and let Notepad accpet "hello" as keyboard inputs.
I tried PostMessage to it directly. But it seems it will not response to my message. (I used another little program to prove that all these KeyUP and KeyDown messages are sent correctly). So I think there is some windows mechanism which makes un-active windows response to kb message.
I have no clue at all, any advise is very welcome.
Thanks,
Joe
|
|
|
|
|
Hey i am using CSocket class in MFC.
My program(client) should connect to multiple servers.
I am using single port at client to connect.It's connecting to the first server
successfully.For second server while connecting it's failing.
The error code it's returning is 0x00002748.
What's the meaning of this error code.
Is it possible to connect from the same port to multiple servers.If possible
pls help me.Is there any problem with CSocket class??
Thanks
|
|
|
|
|
Sivaji wrote:
What's the meaning of this error code.
"A connect request was made on an already connected socket."
For anyone learning Windows Sockets development.
http://www.sockets.com/[^]
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
In my project, I need to automate the process of creating a new "incoming" network connection which acts as a server for client connections. We can manually go through this process: "Control Panel" -> "Network Connection" -> "create a new connection" -> Click "next" on the "new connection wizard" dialog -> Choose "set up an advanced connection" -> "connect to another computer" -> choose "Host" ... We can assume that user always select the fixed choice at each step.
Is there scripting tools or Windows API which can automate the above process? Anyboby can give me some hints? Thanks a lot,
-Jeff
|
|
|
|
|
I am sure that all the wizard does is set up registry entries. The trick is to figure out which entries, and set them yourself.
I am sorry, but I do not know what the entries are.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Hi,
i need to find out the amount of processor time used by a process.
My Requirement:
i am running 2 programs.
1) The ACTUAL process.
2) a monitor process.
The ACTUAL process goes into an infinite while
loop. it begins to use a 99% of the CPU time.
i need to detect this condition from the monitor
program and kill the ACTUAL program.
please help, its very urgent.
thank you..
|
|
|
|