|
Actually, there is little chance the executable for WTL is larger. What you are missing is that the MFC version requires the MFC DLLs. These DLLS must be distributed with your application to insure that everyone can run your software.
I am a huge fan of WTL. But in many ways it is more basic than MFC. But that also means that it doesn't get in your way as much as MFC.
IMHO, more experienced programmers should move to WTL. But if you are just creating applications that fit well with MFC, it works just fine. It is really hard to say which would be best to use.
Tim Smith
"Programmers are always surrounded by complexity; we can not avoid it... If our basic tool, the language in which we design and code our programs, is also complicated, the language itself becomes part of the problem rather that part of the solution."
Hoare - 1980 ACM Turing Award Lecture
|
|
|
|
|
I have an SDI application with a single CformView view. I only want the view to be visible in diagnostics mode. Otherwise it should be invisible to the user.
I can hide the app with
CMainFrame::m_pMainFrame->ShowWindow(SW_HIDE);
In the OnInitialUpdate().
But the app still shows up and then goes away. Is there a way to hide it either sooner or all together so the average user never sees it?
Thanks
|
|
|
|
|
Modify the window style in PreCreateWindow() by adding this line:
cs->style -= WS_VISIBLE;
|
|
|
|
|
Thank you. That is perfect.
|
|
|
|
|
How can I authenticate a user in a n-tier application made of a C# Client, a XML Managed C++ Web Service and an SQL Server Database.
The database is 2 tables with each rown contains:
the users table contains the columns:
-username
-password
the personal data table contains the colums:
-username (with a relationship with the first table)
-name
-surname
-address
-phone
The XML Web Service consists of two methods:
Login(username, password)
GetData(?)
UploadChanges(?)
Now It's start to be confusing for me!
I want that only the correct user, authenticated using the data in table Users, can modify the corresponding row in the PersonalData table.
How I accomplish this?
I could setup a cookie like mechanism that asks username and password, gives them to the Login() method, that returns a SessionVariable, and stores them in the PersonalData table. After when a user wants to GetDataFromDatabase of UpdateChanges, it has to give the variable back, and the update is made with a SQL statement like (SELECT FROM PersonalData WHERE CurrentSession = XXX)
Is this method reliable?
Is there a simpler method that I don't know?
Is there any kind of serverside security? Maybe in the SQL Database?
Thanks to anybody who will answer me.
"Nelle cose del mondo non e' il sapere ma il volere che puo'."
|
|
|
|
|
Easiest is to use windows authentication everywhere.
Step back, rub your eyes, take a deep breath, stretch a bit, and reflect on the relative importance of CP, CG, the age / travel time sustained by supposedly 'fresh' cheese curds, and Life in General. - Shog9
|
|
|
|
|
A good way of doing it is ensuring that the SELECT statements are executed against the entered username and password.
For example, on the page where they can edit their details, you could change it so that it will only fill out the form with details from the DB where the user + pass = what was entered. By doing a join with the two tables you can return all the information in one query, and by filtering it this way if the pass or username is wrong, it won't be returned.
Likewise when returning the data back, only update the rows where the user + pass match, for example create a view which joins the two tables (in effect returning user details) and limiting it based on user + pass.
Another way is to store the username in a cookie, as well as a hashed version (with some random text appended). Then, everytime a page is loaded, check that the hashed value matches a hash generated at the time the page is executed. This way, you can be sure that its been issued by you, and not hacked. Then you just have to check its a valid username, if it is, then all is well.
Let me know if there's something I need to explain a little better.
|
|
|
|
|
Can anyone tell me what are the steps to create components that used in IE (without GUI, just like ADO components) ?
Thanks so much ^^
|
|
|
|
|
|
I'm using .NET now. I tried creating a COM control 2 years ago using VS6, but now completely forgot all the stuff.
When I created a ATL Project, it has two projects created, one is MyProjPS and the other one is MyProjPS (supposed to be proxy & stub, right). Then what's next, I should right click on the MyProj and choose Add-New Class, right ? Then what should I choose from the ICONS ? What next then ? ...
I forgot the steps ...
|
|
|
|
|
Let me specify more in details. I created some MFC classes in a DLL for sending some message to a server. Now, I want to wrap the classes with COM, so that they can be used in VB clients and ASP. But I just don't know how to do so.
Should I choose Add->New Class->ATL support to my existing MFC DLL, or create a new ATL project to support MFC and create new com classes call my classes.
I'm quite confused
|
|
|
|
|
ummmm not sure this is the right forum but here goes...
i need to make our software installable thru a web page and i figured out all on my own (wooopeee do) that i have to make an activex installer ... wtf is one of those and how do i make one?
any comments / suggestions welcome
"... and so i said to him ... if it don't dance (or code) and you can't eat it either f**k it or throw it away" sonork: 100.18128 8028finder.com
|
|
|
|
|
Well i did not fully get ur problem but i will explain with what i understood.
U want just to install activex component then u can always use Visual install-shield and prepare the setup which u an upload it and then u can run this setup in any system where u want to install it....
Hope u got something....
If not explain again....
cheers,
Super
------------------------------------------
Too much of good is bad,mix some evil in it
|
|
|
|
|
InstallShield makes a "Install From Web" thing that works fine. You can also write your own ActiveX Component, "embed" it in a webpage, and let the component download and install the software.
If you make your own, you just have the problem with signing it, a certificate for signing is expensive, and most people will not run an unsigned ActiveX Component...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
I've migrated to VC 7.0 few minutes ago and naturally having some problems.
In VC++ 6.0, there is a "project" menu that contains the "settings" item. Right !!!. If we click it, a property dialog appears which contains among many tabs, a "Link" tab. Here we give the path of various run time libraries.
Now how can we achieve this using VC++ 7.0
|
|
|
|
|
In solution explorer, click your project name, and in the properties view, click the property page button.
|
|
|
|
|
Still unable to understand
In order to use multimedia properties in VC++ 6.0 program, we select the Settings option from the Project menu, and pick the Link tab. Then we select General from the Category list box, and add WINMM.LIB ("Windows multimedia") to the Object/Library Modules text box. We need to do this because program makes use of a multimedia function call, and the multimedia object library isn't included in a default project. Otherwise we'll get an error message from the linker indicating that the PlaySound function is unresolved.
Now where we insert such *.lib files in VC++.NET
|
|
|
|
|
|
I created a console application with MFC support. I right clicked on my project in Solution explorer window. A menu opened, whose last option is "properties" and I clicked it. Then I clicked configuration properties. But below that, no option like "linker" is present. Whats that ????
|
|
|
|
|
It's the rightmost "icon" of the properties, click it a property page will come out, then you can choose and change your options like VC++ 6.
|
|
|
|
|
To get the view1 pointer in view2, I did
void CDlgLists::SetCheckDisplayList(int nIndex)
{
CTrain1Doc * pDoc = (CTrain1Doc *)GetDocument();
POSITION pos = pDoc->GetFirstViewPosition();
while (pos!=NULL)
{
CView* pView = pDoc->GetNextView(pos);
ASSERT_VALID(pView);
pView->m_listdisplay.SetCheck(nIndex);
}
}
But when I tried to do something to the listdisplay control, it said its not a member of CView*. I tried (CMyView*) pView->m_listdisplay.SetCheck(index) and it didnt like that either!
What do I do to get a hold of my listcontrol in view1 from view2?
Perplexed,
thanks,
ns
|
|
|
|
|
The sendmessage tactic is working, but I really am curious about the not so clunky way of accessing the control. So if you have any insight I would greatly appreciate it.
Thanks,
ns
|
|
|
|
|
did you try
(CMyView*) pView = pDoc->GetNextView(pos);
?
"... and so i said to him ... if it don't dance (or code) and you can't eat it either f**k it or throw it away" sonork: 100.18128 8028finder.com
|
|
|
|
|
Here's how:
- Add an invisible pushbutton (
IDC_SET_CHECK ) to the form in View2. The IDC_SET_CHECK handler (add it using ClassWizard) should do what you want it to do to the view's list ctrl.
- From View1, get a pointer to View2 and post it the
IDC_SET_CHECK message, eg:
pView2->PostMessage (WM_COMMAND, IDC_SET_CHECK, 0); PS: A better way would be to make IDC_SET_CHECK a hidden menu command instead of clutering up the view's dialog resource with pushbuttons. I often have a menu resource called IDM_HIDDEN_COMMANDS that holds these commands.
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
In a DLL, I have a class CPacketBase, which composed of a class CPacketBaseInitializer, like:
<br />
class CPacketBaseInitializer<br />
{<br />
public<br />
CPacketBaseInitializer();<br />
~CPacketBaseInitializer();<br />
<br />
public:<br />
static m_seqnum;<br />
static m_cs;<br />
<br />
static uint32 getNewSeqNum();<br />
};<br />
<br />
class CPacketBase<br />
{<br />
protected:<br />
static CPacketBaseInitializer m_static_initializer;<br />
}<br />
<br />
CPacketBaseInitializer::CPacketBaseInitializer()<br />
{<br />
InitializeCriticalSection(&m_cs);<br />
}<br />
<br />
CPacketBaseInitializer::~CPacketBaseInitializer()<br />
{<br />
DeleteCriticalSection(&m_cs);<br />
}<br />
<br />
uint32 CPacketBaseInitializer::getNewSeqNum()<br />
{<br />
uint32 ret = 0;<br />
EnterCriticalSection(&m_cs);<br />
ret = m_seqnum++;<br />
LeaveCriticalSection(&m_cs);<br />
<br />
return ret;<br />
}<br />
<br />
It seems that m_cs has never been initialized !!! It died in EnterCriticalSection(). It worked fine when I was using VS6 SP5, but after upgrading to VS.NET, it doesn't work.
|
|
|
|