|
But when am I not ready for sending data then?
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
Chances are that you don't have to subscribe to the FD_WRITE event. Are your writes asynchronous? Yes, then you need FD_WRITE . If not, you don't - you check for readiness when you write data by testing the return value from Send .
--
Ich, du, sie, er, es, ihr, sie, Sie.
|
|
|
|
|
Jörgen Sigvardsson wrote:
you check for readiness when you write data by testing the return value from Send
So, if there is any pending data I send it away in the FD_WRITE handler or something?
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
Yup, that's the general idea.
--
Ich, du, sie, er, es, ihr, sie, Sie.
|
|
|
|
|
I'm trying to write a program that should do the subj.
But I' not able to solve the problem, how can I filter all keyboard inputs?
I used SetWindowsHookEx, but anyway it didn't work.
1)I need to filter ALL input from Kbd & Mouse
2)I need to filter only defined inputs from Kbd & Mouse
Thanks a lot...
|
|
|
|
|
|
Hello everyone, I have a question about how to distribute the MFC DLLs with an application. I have read elsewhere how to distribute the MFC DLLs and which ones I need using Dependency Walker. I have code that properly installs the DLLs, which I believe are for all Windows versions, but I am unsure whether this is the best way to do it under Windows 2000 and XP. Instead of installing the DLLs into the system folder etc., should I put the DLLs in the application's folder along with a .local file? Or should I go ahead and install them into the system as usual for Win95/98/Me etc?
Also, I have Visual C++ Professional, and could statically link to the DLLs. Is there any disadvantage to statically linking to the DLLs, instead of dynamically and having to install the MFC DLLs? Are there times when I should dynamically link, and times I should statically link? (assuming I am running VC++ professional)?
|
|
|
|
|
At some point, redistributing the MFC DLLs is going to cause you and your customers problems. Putting them in the system directory is a crash waiting to happen. How do you know someone else won't come along, and replace your DLLs with another version? If you absolutely have to redistribute them, then put them in the app's directory. Otherwise, you should prepare yourself for customer reports like "I just installed your app, and now this other app doesn't work."
A far better approach is to statically link. This way, you know your app will work, regardless of what's on your customer's machine. And you also know you won't be impacting other apps. You're trading program size for program stability.
Your app will exist long after you have stopped working on it. Do you really want somebody to install your app 10 years from now, and step on some DLLs that another program relies on?
HPS HwndSpy - GUI developer's aid to visually
locate and inspect windows. For the month of August
only, use coupon code CP-81239 for 30% off.
|
|
|
|
|
HPSI wrote:
At some point, redistributing the MFC DLLs is going to cause you and your customers problems. Putting them in the system directory is a crash waiting to happen. How do you know someone else won't come along, and replace your DLLs with another version? If you absolutely have to redistribute them, then put them in the app's directory. Otherwise, you should prepare yourself for customer reports like "I just installed your app, and now this other app doesn't work."
Agreed!
|
|
|
|
|
Hi, I was wondering if there is "report viewer" sample somewhere out there... I need an MS-Access report viewer that does NOT need MS-Access installed on the machine. I understand that in earlier versions of Access, it was possible using the Access Developer's Kit (ADT), but I don't really know how to use it, or any other better and more modern kits - if any exist.
The scenario is this: I have a machine, holding an MS-Access database, that has a few reports in store. The user is using a DIFFERENT computer, and wants to remotely view the reports inside the MS-Access database, but the user doesn't have Access installed.
Thanks..
/=/=/=/=
Deus
/=/=/=/=
/=/=/=/=
Deus
/=/=/=/=
|
|
|
|
|
silly me
|
|
|
|
|
/////////////////////////////////////////
// Convert Texts into Long Block //
/////////////////////////////////////////
for(int m_iCountTeks=0;m_iCountTeks<m_ino_of_longblok4teks;m_icountteks++)
{
="" m_lchar1="(long)((m_sTeks[4*m_iCountTeks]<<24<b">)&0xff000000);
m_lChar2=(long)((m_sTeks[(4*m_iCountTeks)+1]<<16)&0x00ff0000);
m_lChar3=(long)((m_sTeks[(4*m_iCountTeks)+2]<<8)&0x0000ff00);
m_lChar4=(long)((m_sTeks[(4*m_iCountTeks)+3]) &0x000000ff);
m_lTeksArry[m_iCountTeks]=m_lChar1|m_lChar2|m_lChar3|m_lChar4;
}
Hello all,
the codes above is to convert texts into LONG BLOCK.. so i can later store them into the LSB of my BITMAP ( i'm doing digital watermarking).. i got these codes from a friend.. and i cant understand whats the meaning of the BOLD codes above!
I hope you guys can help me figure out.. how the thigns above works...i really need explanation to understand these for my furthers works.
Thanks...
nice day!
Thong
[email]twh81@tm.net.my[/email]
...
|
|
|
|
|
Each is a bitwise "and" operation with an int. This is frequently referred to as a "bit mask", since it allows you to filter out bits which you don't want.
- Mike
|
|
|
|
|
If your question is not some kind of a joke:
Here is an answer:
I assume this code converts array of BYTES into Array of LONGS.
m_sTeks is BYTE array
m_lTeksArry is LONG array.
What each basically does is for each 4 elements in BYTES array:
convert each element to long, by shifting and & so each BYTE element occupies appropriate BYTES in resultan LONG.
However, from what I see you can just easily achieve the same result by doint the following:
for(int m_iCountTeks=0;m_iCountTeks++)
{
m_lTeksArry[m_iCountTeks]= *(LONG *)(&m_sTeks[4*m_iCountTeks]);
}
Regards
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
How do you set the master volume for sound devices? There appears to be no simple way to do this; Every time I try to find something, I end up being bogged 10 miles deep in random WINMM functions that, in my opinion, should've been depreciated about 3 versions ago. Mind you, I don't want to control the WAVE volume, I want the "What you Hear" volume, or in other words, what is set when you left-click the Sound tray icon.
|
|
|
|
|
You're gonna want to use the mixerSetControlDetails() function. See if MSDN article Q178456 helps. It's in VB, but easily translated.
|
|
|
|
|
Hi, guys:
How to convert a non-mfc multithreading vc++6.0 win32sdk program to a mfc one ?
Any suggestion/advice is much appreciated.
TIA
|
|
|
|
|
WHy would you want to do that ? Code in win32 is better than MFC IMHO.
Hari Krishnan
|
|
|
|
|
I have to convert my program to an ocx.
And I've got that it's very difficult to implement it from a win32 one.
Somebody told me it's a little easier to do that from a mfc one.
Am I right or wrong ?
Any advice ?
|
|
|
|
|
If it's a standalone windows program like SDI/MDI/or Dialog: solution maybe very easy:
Just create standard MFC COleControl application:
1. Overload OnCreateWindow -- add to it creation of your main Win32 SDI/MDI/Dialog frame or window; immediately after that call SetParent on it so your Control Window will becomw parent of it -- also you may need to change style of your Win32 window to WS_CHILD -- remeber m_hWnd32 handler to your SDI/MDI/Dialog frame here in one of member variables;
2. Overload OnSize of your COleControl and resize your m_hWnd32 here to occupy all available space of COleControl;
3. Remove message pump from the original code of your application -- you are running on message pump of container now;
4. Add PreTranslateMessage to you COleControl and perform appropriate calls to your win32 app returning true/false if appropriate...
Regards
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
Thanks for your kind and clear direction.
But my program is not a simple SDI/MDI/Dialog one, instead, something more complex.
Does your solution fit this ?
Thank you very much !
|
|
|
|
|
No...;P
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
What a pity!
Are there any other ways in which I can finish my task ?
Thanks a lot for your help anyway!
|
|
|
|
|
Instead of using MFC, why not consider ATL. Yes, writing a control is not necessarily easy, but instead of bloating your control by using MFC, ATL will take much of the pain away...
Steve S
[This signature space available for rent]
|
|
|
|
|
convert my program to a MFC one then convert the MFC one to an ocx. He also told me the first step need only minor change on source and the latter is also not very difficult.
Time is so limited though I'm not familiar with VC++...
Can you give me some further help?
Thank you very much !
|
|
|
|