|
Go for ATL without MFC support. If you include MFC support in your ATL project, your COM object has to start choking up around the MFC runtime DLL. But its true that, you will get all the features in MFC, But you will have to pay for it.
So I would say, its actually a design decision, which you have to take. If you have GUIs, then u may use MFC, otherwise dont go for that. Thats my advice.
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
I have complex mainly GUI application, that was based on MFC,
but threading is also good thing for not to use in any library.
is there method to correctly use GUI libraries in threading environment?
|
|
|
|
|
You can have dialogs ( CAxDialogImpl ) and property sheets in ATL itself. But if you want anything more, use MFC, and choose STA Apartment with 'Apartment' threading model.
Refer msdn for more details
Start here[^]
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
You may not have to worry if MFC is thread safe.
You can use multi-threading with an MFC application as long as you always use the MFC stuff from the main thread. What are you using multi-threading for? If you just need working threads to do some calculations in the background without directly touching the UI, you can do that fine.
|
|
|
|
|
Yes, sometimes this is so. Thanks for your opinion.
It is to be related to all MFC objects is registerd at one thread.
So it is possible to make other thread that interacts "by handle"
with other threads...
But this is complex to check sometimes in complex GUI systems.
And blocking with reenterancy- is a problem still.
|
|
|
|
|
In an application, we have the task to identify users (with a username and a password).
The best for us would be if there is a function, where we can pass the username / password entered by the user and find out, if this is the correct combination.
Is there any possibility doing this ?
Thanks in advance,
Bernhard
"I'm from the South Bronx, and I don't care what you say: those cows look dangerous." U.S. Secretary of State Colin Powell at George Bush's ranch in Texas
|
|
|
|
|
Is this on a Windows Domain (NT/2K/2003) or just W9x/ME?
If there's a domain controller involved, there is code which allows you to do this, although it's fairly convoluted. If the latter, then I think you'd have to have something application specific.
Steve S
|
|
|
|
|
well there is a domain controller.. all the servers should (at least) have win2k.. there are some nt4 clients, the rest is win2k..
Would be very nice if you sent me the piece of code..
"I'm from the South Bronx, and I don't care what you say: those cows look dangerous." U.S. Secretary of State Colin Powell at George Bush's ranch in Texas
|
|
|
|
|
I got the original code from Keith "Mr. Security" Brown, on the developmentor website, and made some minor changes; sent off-thread, since it's a large function
Steve S
|
|
|
|
|
sending it off-thread didn't work though.. i have already sent you an e-mail.. could you send it directly to my e-mail adress? (the one i've sent you the e-mail)
would be very nice..
"I'm from the South Bronx, and I don't care what you say: those cows look dangerous." U.S. Secretary of State Colin Powell at George Bush's ranch in Texas
|
|
|
|
|
I have this situation where I have to dynamically set the PATH variable used by the application.
Imagine I have 2 versions of mylib.dll:
c:\version1.0\mylib.dll
c:\version1.1\mylib.dll
My PATH variable is c:\version1.1; c:\version1.0
Now, my application links to mylib.lib, so whenever I startup my application, it is looking for the mylib.dll based on my PATH settings.
What I want to accomplish is to give the user the possibility to specify which version of the dll is going to be used by the application (via a dialog box).
So I thought the solution was to overrule the default PATH variable used by the application by my own one (c:\version1.0\mylib.dll needs to be used).
Is this possible? How to accomplish this?
Thanks in advance
Wim
|
|
|
|
|
Could you dynamically link to the DLL and use LoadLibrary() to specify the path for the DLL?
Systems AXIS Ltd - Software for Business ...
|
|
|
|
|
Hello,
I'm afraid that is not possible. Well, it might be possible, but the problem is that there are a lot of dll's invloved, and the references change over time.
So I really need to stick to the .lib usage.
|
|
|
|
|
Wim Jans wrote:
So I thought the solution was to overrule the default PATH variable used by the application by my own one (c:\version1.0\mylib.dll needs to be used).
Is this possible? How to accomplish this?
SetEnvironmentVariable() comes to mind.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Look at the "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths" entry in Registry. It's the modern approach now. You may use it for your purpose.
For example,
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\someserver.exe
@="S:\SRV7\Run\Release\bin\someserver.exe"
"Path"="S:\SRV7\Run\Release\bin\;S:\SRV7\Run\Release\dll\"
NOTE There is the separator ";" between pathes.
With best wishes,
Vita
|
|
|
|
|
Dear all
CString aStr="Learning 中文"; //a mixed English and Chinese string
Extracting each Chinese Character from The String and assign it to a UINT data type.
UINT aWord = ????
i use _MBCS not unicode
can someone tell me how?
|
|
|
|
|
Hi !
I upgraded my VC++ to 2003 cause the compiler now supports partial template specialization. But i now have the following problem:
Suppose the following code:
--- snip ---
class Test: public std::ostringstream {
public:
Test(const std::string& str);
};
Test::Test(const std::string& str)
: std::ostringstream()
{
*this << str;
}
---- snip ---
This does not compile (error C2679) cause the compiler could'nt find a matching binary operator. What the hell is going on here ? This code compiles on every other compiler i've used (gcc 2, gcc 3, VC6, VC7). Is the compiler buggier than before or am i missing something ?
Many thanks in advance,
Christian Prochnow
|
|
|
|
|
I'm just looking for an easy approach to build a dde server to provide changing data retrieved from internet ressources to other apps (e.g. Excel). Are there any good examples using the MS ddeml library
Alternatively an easy to use ActiveX-control wrapping this stuff would be great appreciated
Thanks for your help.
Mathefreak
|
|
|
|
|
If you want to make Excel a DDE Server
you can try something like this:
DDE Service : EXCEL
DDE Topic : Book1:Sheet1
DDE Item : R2C2 ( refers to Row2, Column2 )
or if you want to create DDE server,
see the SDK DDEML sample "Server Sample: DDE Server" in MSDN.
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
Hi All,
I'm a beginner. I tried using CToolTipCtrl as given in MSDN but tooltip display is not happening.This is what I've done.
CToolTipCtrl m_ToolTip;
m_ToolTip.Create(this, TTS_ALWAYSTIP);
m_pToolTip.AddTool(...)
m_ToolTip.SetToolInfo(&ToolInfo);
and in PreTranslateMsg
m_ToolTip.RelayEvent(pMsg);
Create and Addtool does not return failure msg and it does not throw any error but still there is no display. Can anyone pls help me out
with this?
meenu
|
|
|
|
|
Creating and displaying tooltips is really a hard job.
Anyway try this link:
http://www.codeproject.com/miscctrl/tooltipex.asp
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
Hi,
Thanx a lot for ur response. But as I told u, I tried it out as mentioned in the link only...But still, There is no tooltip display. Can u figure out what could be the problem.
With thanx,
Meena
|
|
|
|
|
Is it a dialog/view based app ??
Can u give little bit more insight into the scenario ??
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
dear all,
how can i terminate my dlg based mfc app gracefully from a 1) cdialog based class and 2) from the main application class
currently i'm using
AfxGetMainWnd()->DestroyWindow() in both the cases.........is this approach neat?
thnx
rIsHaBh
|
|
|
|
|
1. Call CDialog::OnOK() / CDialog::OnCancel() depending on the return value needed.
2. If you are using DoModal() method to show the dialog, then your main thread is already blocked, so it is just not possible to dismiss the dialog from main thread. If you ar using Create / ShowWindow( ... ) to show the dialog, then you can use DestroyWindow() on the dialog reference.
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|