|
1. first line in DbClass.cpp and AdoX.cpp should be "#include "stdafx.h""
OR
2. you should disable precompiled headers for those files in compiler settings
|
|
|
|
|
The only diff in my working project that uses these files and my new one is that the od one had YX, not YU in the C++ tab of settings. I made this change manually and it works but I am nervous....
In my old project even the offending files were "automatic use of precompiled headers..."
ANyways after I looked at what doing the YU --->YX did toi my current project - it said not to use precompiled headers. I looked at my old program -- it said to usre automatic precompiled headers EVEN THOUGH it has YX......so in my currrent I selected "automatic use " and looked back in my c++ tab and its till YX...."
What I'm trying to say is that (in my new proj) it was set to "dont use precompiled" (maybe because I changed the Yu to a YX...dont know). Things worked then. Next I selected "automatic use..." and the YU change I made to YX didnt change back to YU...
GEt a warning :Command line warning D4025 : overriding '/Ycstdafx.h' with '/YX/FoDebug/'
Is this dangerous?
Appreciate your help,
ns
|
|
|
|
|
/Yu - it means that file specified (usually "stdafx.h") already precompiled into ".pch". It also means that it MUST BE FIRST INCLUDE in your .cpp.
/YX - in simple terms compiler try to guess which header to make into precompiled. There is bunch of "if", "but" and other conditions - usually it defeats the whole purpose of precompiled headers.
|
|
|
|
|
Inspite of the stadfx being first in my files it was still unahppy till I said automatic use...
Appreciate your help,
ns
|
|
|
|
|
add following line at top DbClass.cpp and AdoX.cpp:
#include "stdafx.h"
A. Riazi
|
|
|
|
|
|
Thanks!
Appreciate your help,
ns
|
|
|
|
|
I was created Toolbar using CToolBarCtrl class.But I was unable change the state of the button?
How to change the state of the Button?
|
|
|
|
|
Use OnCommandUpdate message handler.
A. Riazi
|
|
|
|
|
I was created Toolbar using CToolBarCtrl class.But I was unable change the state of the button?
|
|
|
|
|
Hi,
I want to list all the application running in my machine currently. Is there any API which gives me that information. I used Process32First() and Process32Next() APIs to get the process list. Anything similar to this for the Application list?
Kindly help....
Vini
|
|
|
|
|
Are you speaking about the TaskManagers tab "Applications"? Then EnumWindows is possibly what you're looking for.
|
|
|
|
|
Mike Nordell wrote:
Are you speaking about the TaskManagers tab "Applications"? Then EnumWindows is possibly what you're looking for.
yes.. I want all the currently running application like in the taskmanager. Tnx for the help. I'll try this .
Vini
|
|
|
|
|
Look at he code provided in this article[^]. The functions FillList and ListWindows should help you retrieving the app names.
~RaGE();
|
|
|
|
|
Rage wrote:
Look at he code provided in this article[^]. The functions FillList and ListWindows should help you retrieving the app names.
Got it!!! Thank you very much..
Vini
|
|
|
|
|
Use EnumProcess!
There are some articles on CP.
A. Riazi
|
|
|
|
|
Hi,
I'm macking a Container application that hosts Activex Controls. I'm trying to provide scripting facility to my application using IActiveScriptSite. How do i expose the interfaces of the ActivexControl (i.e properties and methods) to the Scripting engine. any help would be highly appreciated.
|
|
|
|
|
IActiveScript::AddTypeLib
|
|
|
|
|
I have a class A{ public :CString m_str;}
static int func()not in the class. How can I acess m_str in this function func()
|
|
|
|
|
make an object of this class like A b;
and use it like b.m_str; or make get set functions in class..and then use those functions..but first include this file into the file where your function is if they are in separate files ..i hope this works..
cheers
Himanshu
|
|
|
|
|
The case is as below
class A {public cstring mstr;
func();}
static int CompareModes(const void *arg1, const void *arg2 );
A::func()
{
....
qsort ((void *)lpModes, (size_t)cModes, sizeof(LPDDModeInfo), CompareModes);
}
int CompareModes(const void *arg1, const void *arg2)
{
CB *p1, *p2;
p1 = *(CB**)arg1;
p2 = *(CB**)arg2;
CString str1, str2;
str1 = p1->GetValue(mstr);
str2 = p2->GetValue(mstr);
return str1.CompareNoCase(str2);
}
here I need to access mstr in the static func CompareModes
|
|
|
|
|
hi,
thats what i was telling you..but i guess you didn't understood..anyway..inside your function like this
int CompareModes(const void *arg1, const void *arg2)
{
[red]
a b;
CB *p1, *p2;
p1 = *(CB**)arg1;
p2 = *(CB**)arg2;
CString str1, str2;
//in place of mstr use b.mstr and that will do..
str1 = p1->GetValue(mstr);
str2 = p2->GetValue(mstr);
return str1.CompareNoCase(str2);
}
i hope you r done this time..
cheers
Himanshu
|
|
|
|
|
I guess more info had to be given, A is a dlg class and I have a combo in it and onSelandOK I fill the mStr member. The on clicking another button I do some sorting and there in I need the mstr. So there is no point in creating a new obj in comparemodes. I need to access the member's value of the same obj that's calling func()
|
|
|
|
|
You should not retrieve the string value in CompareModes, but in your dialog. Extend your comparison function to pass the strings retrieved in parameter.
Crap, you cannot since CompareModes is a callback. Why is your pointer cast not working ? Does it compile ? If yes, do you have an error at runtime ?
~RaGE();
|
|
|
|
|
that's what was my secong idea..use get and set functions like..
void setmstr(cstring _mstr){mstr=_mstr;}
CString Getmstr(){ return mstr;}
so where you click to set mstr call setmstr() and it will store the value for you and where you need the value call getmstr() function which returns a CString..
so i guess that will do..
PS don't unfold the problem one by one..its gud to understand each and everything once..
Himanshu
|
|
|
|