|
You can download symbols from microsoft.com/ddk[^]
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Hi guys,
I need some help in creating concurrent threads. I am running a TCP Server which accepts the clients, I am calling AfxBeginThread passing the newsocket id to that. I want to run a seperate concurrent thread for each client which is connecting to my server for some file transfer. Can anybody suggest some solution. Any links or references will help me. Thanks.
satya
|
|
|
|
|
|
Why do I get a Debug assertion, when I have some watches concerning my CArray? Isn't that kind useless, when i can kill my program when debugging and adding a wrong "watch-line"?
I don't want achieve immortality through my work - I want achieve it through not dying - Woody Allen
|
|
|
|
|
CArray is crap. Don't use it.
Christian
come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002
|
|
|
|
|
Hi All !
One problem pursues me for a few years already:
all my Win32 apps, written in VC++ (5.0-6.0),
crash on the second run under debugger.
Toolbar code in comctl32.dll causes access violation.
In more details:
1)The crap arises only when the app
is run 2 times successively from the VC++ IDE.
When running my app standalone, all's ok.
2)The program crashes when a mouse is moved
over the toolbar. WM_MOUSEMOVE is finally
dispatched to DefWindowProc() in comctl32.dll,
and there fails.
The mouse coordinates seem to be correct.
3)If toolbar is hidden, it's allright.
4)This bug seems to be not accidental
concatenation of circumstances:
this happened on different Windows versions,
under both VC5 and VC6, after many reinstallations
of the VC++ and OS etc,
and, finally, with all my Win32 GUI apps -
independently of tyhe architecture of the app,
and of the way I use tollbars
(containing ReBar, different styles, etc.)
5) The bug arises and disappears from time to time,
during the course of program development.
It seems that it depends somehow
on the size of the .exe or something like that.
Anyone ever faced this problem ?
Any help or hint would be appreciated !
Thanks in advance !
|
|
|
|
|
I am facing the following peculiar problem:
1. Create a dialog based applications.
2. Show a modeless dialog box on click on a button
3. Show an AfxMessageBox on click of another button on base dialog.
4. Close the modeless dialog box.
5. Now you can click on any button on the base dialog to create a second afxmessagebox,while the first one is still displayed!!!!
How can you prevent this?
|
|
|
|
|
You can keep all the modeless dialogs in a CWnd* p[max_no_modlesses] and:
void CDlg::OnButtonAfxMessageBox()
{
for (int i=0; i<no_modelesses; i++)
p[i]->EnableWindow(FALSE);
AfxMessageBox("AAAAAAAAA");
for (i=0; i<no_modelesses; i++)
p[i]->EnableWindow(TRUE);
} I assume you don't want to manipulate any modeless while AfxMessageBox is "running".
rechi
|
|
|
|
|
How can I create a MSI file for my VC .NET project ? I created a very simple COM, and want to distribute to clients. What the MSI needed is just put my DLL in a place, and install VC7 related stuff to run my DLL together with registration it correctly.
Can I still use the Free Windows Installation tool exists in VS6's platform SDK ?
I don't want to buy InstallShield as it's quite expensive. More expensive than VS.NET.
|
|
|
|
|
|
Oh...thanks, it's creating another project, not a seperate tool.
|
|
|
|
|
However, I still got problem. My COM DLL is dependent on another traditional DLL developed in VC++ .NET. In order to work properly, any merge_modules I should add too ? Should I add VC_atl, VC_stl, VC_CRT, VC_MFC ? It is by default added dotnetfxredist_x86_enu.msn, so i don't have to bother about the .Net framework installation, right ?
|
|
|
|
|
|
My project's view class is not derived from CScrollView and the view area is a Modeless dialog, which contains a RichEditCtrl.
Can anybody give any help on how to add scrollbars to scroll RichEditCtrl's contents in the Dialog Window???
(Creating the RichEditCtrl using WS_VSCROLL and WS_HSCROLL doesn't help as I need the scroll bars to be in the Dialog window).
I appreciate any help!!
|
|
|
|
|
I want to improve my application with two techniques:
1. Plugins. I think it's better to export application class (object). Should I use COM or something else?
2. Automation. So my app could be called/controlled by another. Should I get into OLE automation/IDispatch stuff?
It's new deal to me so I really need advices from more experienced programmers.
Thanks in advance
|
|
|
|
|
As for your first question:
You shouldn't, but you may.
You can use COM, but remember that the only way
to identify a COM class is its CLSID (GUID).
Therefore, your main program (client) would have to know
CLSID's of all plugins existent on the machine.
Plugins should have to register (as any COM servers),
and should make the main program know their CLSID's.
Plugin DLL's can locate anywhere.
So, the usual approach to plugin search
in a fixed directory (e.g., as in FAR)
is not applicable in this case.
Whether to use COM or not, depends much on the way
the plugins should be written.
If you want any third party to be able to write a plug-in
using any development tool, you'd better use COM.
If you plan to write them yourself,
you may use just DLL's with a fixed set of entry points
(imho, COM development is not that simple,
especially for the beginner - mainly, bcause of the
huge set of specific terms involved
in the description of its techniques).
As for your second question:
Yes, you should.
It seems to be the only way.
|
|
|
|
|
Well, I see that the usage of every plugin like a COM-server is too expensive and tricky.
And what about mixed technique?
1. Fixed set of entry points (just to initialize plugin and to obtain menu entries and corresponding functions addresses). Using COM-friendly and language-independent syntax, of course.
2. Host app starts one of the plugin's function. Handler is about to get (or it may be done on initialization phase) "Appclass" object with known single COM-interface of Appclass. (is it Automation itself? )
So, the idea is to make plugin work like hostapp COM-client.
What do you think?
|
|
|
|
|
If you rely on the set of DLL entry points,
you also imply certain call agreement for
these exported functions.
What are the advantages of using mixed approach ?
I can see none.
If you decided to use COM, you'd better export from the plugin
nothing than one COM class (maybe, with a single inteface).
You can initialize plugin, obtain menu entries, etc.,
just via that interface.
The point is, if you avoid using COM,
you simplify the task for yourself.
Buyt if you do use COM, then better
do everything via it.
The mixed technique will be both complex
and less portable.
If your plugin is a standalone DLL,
serving as an extension to your specific application,
I suppose it's not yet automation.
Automation, afaik, refers to the usage of the objects
implemented in one program from another one,
or control of one application over another.
E.g., from your app you start Word, open some document,
make there text replacement, close it, etc.
|
|
|
|
|
As for your first question:
You shouldn't, but you may.
You can use COM, but remember that the only way
to identify a COM class is its CLSID (GUID).
Therefore, your main program (client) would have to know
CLSID's of all plugins existent on the machine.
Plugins should have to register (as any COM servers),
and should make the main program know their CLSID's.
Plugin DLL's can locate anywhere.
So, the usual approach to plugin search
in a fixed directory (e.g., as in FAR)
is not applicable in this case.
Whether to use COM or not, depends much on the way
the plugins should be written.
If you want any third party to be able to write a plug-in
using any development tool, you'd better use COM.
If you plan to write them yourself,
you may use just DLL's with a fixed set of entry points
(imho, COM development is not that simple,
especially for the beginner - mainly, bcause of the
huge set of specific terms involved
in the description of its techniques).
As for your second question:
Yes, you should.
It seems to be the only way.
|
|
|
|
|
I Read the article http://www.codeproject.com/useritems/asyncwininet.asp;
and write the code like 'asyncdemo' which from msdn:
http://msdn.microsoft.com/downloads/samples/internet/default.asp?url=/downloads/samples/internet/networking/asyncdemo/default.asp
but I have a question
when I call InternetQueryDataAvailable() ,it return ERROR_IO_PENDING
then I will recieve a callback status :INTERNET_STATUS_REQUEST_COMPLETE
and the LPINTERNET_ASYNC_RESULT (lpvStatusInformation)->dwError!=0,
the download incorrect.
what's the matter???
the 'asyncdemo' alse download file incorrect
who have the source code of asynchronous download
thanks very much
|
|
|
|
|
Before asking Chris to add this one as a 'bug' in MSDN, maybe someone can shed a light on the following.
In MSDN for CRect::Width() I read:
Calculates the width of CRect by subtracting the left value from the right value.
The width can be negative
I read something analog for CRect::Height():
Calculates the height of CRect by subtracting the top value from the bottom value. The resulting value can be negative.
And in a note for both:
The rectangle must be normalized or this function may fail. You can call NormalizeRect to normalize the rectangle before calling this function.
While I read for CRect::NormalizeRect():
Normalizes CRect so that both the height and width are positive.
Then is my question: "How can the result of CRect::Width() or CRect::Height() be negative if you must normalize it first?
|
|
|
|
|
Use the source, Luke ...
From afxwin1.inl (VC6):
_AFXWIN_INLINE int CRect::Width() const
{ return right - left; }
_AFXWIN_INLINE int CRect::Height() const
{ return bottom - top; }
These function can't fail, unless MSDN means returning negative value by failure.
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
i want drag a URL in IWebBrowser2. and release mouse in the same window. and open the URL. so i use IWebBrowser2::put_RegiseterAsDropTarget. but no effect. why.
i'm sorry for my eng is too bad. i'll try my best to clarity.
|
|
|
|
|
Hi,
I am facing a problem.
Following is the description:
I have a COM server(EXE).
It has a method, "ServerMethodAAA". The "ServerMethodAAA" method, calls a Dll function, "DllFuncDlg()". "DllFuncDlg()" function invokes a dialog box.
I have a client app for my COM Server, which loads COM Server in hidden mode.
Problem:
When client calls method, "ServerMethodAAA", the dialog is displayed in hidden mode. That is, behind client application. I want that dialog should appear in fore ground window.
Please suggest me.
Regards.
|
|
|
|
|
Is the dialog a modal dialog (stops program execution until you close the dialog). If so the only thing that you will be able to do is modify the code inside the DllFuncDlg() function to make sure that the dialog is brought to the foreground with a call to SetForegroundWindow().
Otherwise if the ServerMethodAAA function returns and the dialog is a modeless dialog, then you can call SetForegroundWindow right after your call to ServerMethodAAA.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|