|
Hi Alok
Am sorry to bug you. I am an amateur and starter in VC.
Still i am getting the same linker error. Can i get list of things i need to check.
Regards
Anandan
|
|
|
|
|
cuteanniyan wrote: Am sorry to bug you. I am an amateur and starter in VC.
Hain don't need to be Sorry... I am too Amateur in VC.
cuteanniyan wrote: Still i am getting the same linker error. Can i get list of things i need to check.
Anyways, it will be better to use these apis CreateToolhelp32Snapshot(...),Process32First(...) and Process32Next(...), here is code snippet to achieve same. here, m_mapProcesses is type map<CString,DWORD> m_mapProcesses;
HANDLE hProcess;
PROCESSENTRY32 ppEntry;
ZeroMemory(&ppEntry,sizeof(ppEntry));
ppEntry.dwSize=sizeof(ppEntry);
hProcess=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,NULL);
if(INVALID_HANDLE_VALUE==hProcess)
return FALSE;
if(!::Process32First(hProcess,&ppEntry))
{
CloseToolhelp32Snapshot(hProcess);
return TRUE;
}
BOOL bTrue=TRUE;
while(bTrue)
{
this->m_mapProcesses[ppEntry.szExeFile]=ppEntry.th32ProcessID;
if(GetLastError()==ERROR_NO_MORE_FILES)
{
CloseToolhelp32Snapshot(hProcess);
return TRUE;
}
bTrue=Process32Next(hProcess,&ppEntry);
}
CloseToolhelp32Snapshot(hProcess)
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
I migrated a VS2002 solution to VS2005 (MFC application with some DLLs). It compiles without any problem - the warnings from _tcscpy and such methods was fixed. However I can't run the application because it can't locate the MFC80UD.DLL module. When I check the application in Dependency walker it loads without any problem. Even in the Debugger's output window I can see that the given modul loaded the symbols. It reports:
Debugger:: An unhandled non-continuable STATUS_DLL_NOT_FOUND exception was thrown during process load
I also tried to move the MFC module to System32 folder however it caused another failure during the application start - some manifest issue. To be honest I do not understand this - at least I don't know how to fix it. I just know that this stuff solves the DLL hell problem - different versions of the same DLL.
Any idea what is wrong?
Thanks,
Abyss
|
|
|
|
|
I continued with my investigation and found that if I copy the missing MFC80UD.DLL module from the WinSxS folder to the application's folder then the debugger shows the following:
'App.exe': Loaded 'C:\Out\App.exe', Symbols loaded.
...
'App.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.DebugMFC_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_c8452471\mfc80ud.dll', Symbols loaded.
...
'App.exe': Loaded 'C:\WINDOWS\system32\winspool.drv', No symbols loaded.
Here the module not found message is displayed if the MFC module is not at app folder.
'App.exe': Loaded 'C:\Out\mfc80ud.dll', Symbols loaded.
Well and I'm surprised, because the MFC module gets loaded twice. Can explain anybody why?
Thanks,
Abyss
|
|
|
|
|
I have a C++ app that includes a 3rd party library that has a type called
'System'. This class exists in a namespace, let's call it XYZ::System.
Then I am compiling my C++ app with /clr and somehow when VC8 includes
xlocale (which in turn uses a macro defined in yvals.h) that calls a method in .NET (System.bla.bla) there is an ambiguity.
How can I resolve this easily?
|
|
|
|
|
Hi,
You probably used the using directive the simplefy the usage of the System class like this:
using namespace XYZ;
void Function()
{
System obj;
...
} This indeed conflicts with the System Namespace of .Net.
In this case you will have to remove the using directive and use the System class like this:
void Function()
{
XYZ::System obj;
...
}
Or
If the third party library is a type library like the ado objects then you could try to use the rename directive and change the System class while importing the type library like this:
#import "XYZ.dll" rename("System", "XSystem")
...
using namespace XYZ;
void Function()
{
XSystem obj;
...
}
Hope this solves your problem
codito ergo sum
|
|
|
|
|
Thanks, the 3rd party library is actually a static lib but I do have the source to it. So I guess I can go through it and do a replace on "System" to make it "XYZ::System". Is it possible to use #import on a .lib file? That would be easier but I guess its not that big a deal, one find and replace should do the trick.
|
|
|
|
|
Alright I tried to simply add XYZ:: to all instances of System in the headers of the 3rd party library , but I realized that the problem is with microsoft's yvals.h usage of System.bla.bla when I've included XYZ as a namespace. It's not working.
I am going to have to rename and rebuild the entire 3rd party library, and everything that uses it.. What a major pain in the neck.
|
|
|
|
|
we need a Character set that supports all Language(like Jap.., Chain..etc.) character. we want in our edit box user can past any language character at same time.we tried fcsuicode but it does not meet our requirement.
-- modified at 1:36 Wednesday 23rd November, 2005
|
|
|
|
|
anilksingh wrote: we need a Character set that supports all Language(like Jap.., Chain..etc.) character. we want in our edit box user can past any language character at same time.we tried fcsuicode but it does not meet our requirement.
What about enabling UNICODE support in your Application!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hi All,
I want to extract the cookies from a HTTP response.
i need to know how the request should b made to get the cookies for a given URL.
Please suggest me regarding the structure of a HTTP request which will accept cookies in response and the sequence of WinInet calls to b made to achieve the task.
Thanks
|
|
|
|
|
Hello
I am working with MFC to create a program to read linux ext2 file system. I am using CreateFile(...). Can anyone please tell me how can i jump to some location within floppy directly that is if i want to read directly block# 3 of floppy how can i do that?
Waiting for kind responce...
Aqueel A. Mirza
we believe in excellence
|
|
|
|
|
|
Hello,
This is a case where CFloppyDisk TwoPointO[^] might come in handy.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
do you know what window's message (WM_XXX) is sent when user clicks a popup menu to drop down its contents (menu items)?
the menu is main menu of a dialog-box.
includeh10
|
|
|
|
|
Isn't it the WM_COMMAND message. It's for almost the menu items...
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
When a menu pops up it sends this message
WM_INITMENUPOPUP
<marquee direction="up" height="30" scrolldelay="1" step="1" scrollamount="1" hspace="0" vspace="0">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
Hi..
I'm very new to C++ and have just written 2 methods that are pretty unstable (ie. same input may or may not run correctly). My gut feeling tells me it's because of my poor memory and string management. Could someone kindly review the code and let me know if there's any obvious error? I would seriously very appreciate it.
Method 1
============
char* _LoggedInUserID;
char* _LoggedInUserName;
DWORD CALLBACK streamDisclaimer(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
{
DWORD read;
CRtfStream *st = reinterpret_cast<CRtfStream *>(dwCookie);
const int MAX_USER_TAG = 10;
char* userTag = (char*) malloc(strlen("<user>")+1);
strncpy(userTag, "<user>", strlen("<user>"));
userTag[strlen("<user>")] = '\0';
size_t displayLen = strlen(_DlgLoggedInUserID);
if(_DlgLoggedInUserName != NULL) displayLen += strlen(_DlgLoggedInUserName) + 3; char* displayStr = (char*) malloc(displayLen+1);
if(_DlgLoggedInUserName != NULL){
sprintf(displayStr, "%s (%s)", _DlgLoggedInUserName, _DlgLoggedInUserID);
}else{
sprintf(displayStr, "%s", _DlgLoggedInUserID);
}
displayStr[displayLen] = '\0';
LPBYTE tmpBuff = new BYTE[cb + (displayLen*MAX_USER_TAG)];
ReadFile(st->fileDisclaimer.get(), tmpBuff, cb, &read, NULL);
string tmBuffStr = (char*) tmpBuff;
size_t iPos = tmBuffStr.find(string(userTag), 0);
if(iPos != tmBuffStr.npos){
int cnt = 0;
while(iPos != tmBuffStr.npos && cnt < MAX_USER_TAG){
tmBuffStr = tmBuffStr.erase(iPos, strlen(userTag));
tmBuffStr.insert(iPos, displayStr);
iPos = tmBuffStr.find(string(userTag), 0);
cnt++;
}
int newLength = read - (strlen(userTag)*cnt) + (displayLen*cnt);
strncpy((char*)pbBuff, tmBuffStr.c_str(), newLength);
pbBuff[newLength] = '\0';
*pcb = newLength;
}else{
strncpy((char*)pbBuff, (char*)tmpBuff, read);
*pcb = read;
}
delete [] userTag;
delete [] displayStr;
userTag = NULL;
displayStr = NULL;
tmpBuff = NULL;
return 0;
}
Method 2
=============
char* _DlgLoggedInUserID;
char* _DlgLoggedInUserName;
void CGina::setLoggedInUserID(PWSTR pszUserName){
delete [] _LoggedInUserID;
delete [] _LoggedInUserName;
_LoggedInUserID = NULL;
_LoggedInUserName = NULL;
if(pszUserName != NULL)
{
int nstrlen = WideCharToMultiByte(CP_ACP, 0, pszUserName, -1, NULL, 0, NULL, NULL);
PSTR UserNameStr = (PSTR)HeapAlloc(GetProcessHeap(),0,nstrlen);
if(UserNameStr!=NULL){
WideCharToMultiByte(CP_ACP, 0, pszUserName, -1, UserNameStr, nstrlen, NULL, NULL);
_LoggedInUserID = (char*)malloc(nstrlen);
strncpy(_LoggedInUserID, (char*)UserNameStr, nstrlen);
for(int i = 0; i < nstrlen; i++){
_LoggedInUserID[i] = toupper(_LoggedInUserID[i]);
}
HeapFree(GetProcessHeap(), 0, UserNameStr);
}
}
try {
DirectoryEntry* directoryEntryUser = new DirectoryEntry(S"LDAP://xxx.com.au/dc=xxx,dc=com,dc=au");
DirectorySearcher* directorySearcherUser = new DirectorySearcher();
directorySearcherUser->Filter = S"(objectClass=user)";
directorySearcherUser->SearchRoot = directoryEntryUser;
char* filterStr = (char*) malloc(strlen("samaccountname=")+strlen(_LoggedInUserID)+1);
sprintf(filterStr, "samaccountname=%s", _LoggedInUserID);
filterStr[strlen("samaccountname=")+strlen(_LoggedInUserID)+1] = '\0';
directorySearcherUser->Filter = filterStr;
SearchResult* searchResultUser = directorySearcherUser->FindOne();
if(searchResultUser->Properties->Contains(S"cn")){
IEnumerator* myEnum = searchResultUser->Properties->Item[S"cn"]->GetEnumerator();
while (myEnum->MoveNext()) {
String* fullNameStrPtr = (String*)myEnum->Current;
char* fullNameChar = (char*)(void*)Marshal::StringToCoTaskMemAnsi(fullNameStrPtr);
_LoggedInUserName = (char*)malloc(strlen(fullNameChar)+1);
strncpy(_LoggedInUserName, (char*)fullNameChar, strlen(fullNameChar));
_LoggedInUserName[strlen(fullNameChar)] = '\0';
delete [] fullNameChar;
fullNameChar = NULL;
fullNameStrPtr = NULL;
break;
}
myEnum = NULL;
}
delete [] filterStr;
filterStr = NULL;
directoryEntryUser = NULL;
directorySearcherUser = NULL;
searchResultUser = NULL;
} catch (Exception* e) {
LDB1(L"<--setLoggedInUserID (%s)", e->Message);
}
}
Thanks guys
-- modified at 0:56 Wednesday 23rd November, 2005
|
|
|
|
|
:-Di need the variuos methods that are used in MSChart, to use in VC++.
in my project i need to show the scale on the x & y axis, of the graph and then label it. but i dont know how to go about it.
please help it with it.
Namrata
|
|
|
|
|
I would like to ask a question on how to create/insert an HTML control (like a checkbox or a radio button group or a text field) in a MDI Window application designed using MFC.
|
|
|
|
|
CWebBrowser2 is an ActiveX html control.
includeh10
|
|
|
|
|
Hello everybody,
I am trying to make multiple language support for my VC++ 6.0 dialog based project. I have all dialogs in one language, which is English. I have made resource only DLLs for all languages which I need to support. Both, the main application and DLL are UNICODE enabled. In the resource only DLL, there is string table which has the tranlation of strings for their respective languages. Now comes my problem. I am facing problem when I am trying to make the string table for Asian languages. I have set the language of String table to Chinese(Taiwan) and I have also installed the Chinese language pack. When I try to paste some Chinese text in the String table of Chinese DLL, the text pasted is some question marks. When I run the application, the same question marks are displayed. But, when I paste "1/2T(c)w" ((c) is for copywrite symbol), which I got from the resource file of dialog application which I made in Chinese language, it displays proper Chinese euivalent for "OK".
In a nutshell, I cannot copy any Chinese text in the Chinese Resource only DLL. If anyone knows the solution please help me!
-- modified at 12:46 Wednesday 23rd November, 2005
|
|
|
|
|
I have a window handle but I can determine that window is a datagrid or not. ::GetClassName(), ::GetClassLong() don't work. Plz help me!
Thanks!
|
|
|
|
|
I have done some looking around on here and on the Internet but might still be missing what I am looking for so here goes: I have been trying to compile galblast 1.6 on VC6 and the only thing I need are a set of input/output calls to the parallel port. I have been working with the inpout32 dll but without much success. I did find a page on the internet(http://cet.ssu.portsmouth.oh.us/~pyost/etec351/pport.html) that helped. I was able to get the inp32 and out32 functions to work. When I bring the code to the galblast C file it has trouble. Is there a way to get inpout32 dll to work with C or compile the C source with the CPP portion containing the inpout32 dll functions?
|
|
|
|
|
Hello. A quick check tells me that the funcs in the dll is written in plain C.
You doesn't provide the error message, but I suspect you get a link error, (missing functions) right?
If that's the case, try this in your source code
extern "C" {
short _stdcall Inp32(short PortAddress);
void _stdcall Out32(short PortAddress, short data);
};
Then the C name mangling is suppressed.
Kakan.
|
|
|
|
|