|
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.
|
|
|
|
|
I did get the missing functions error as you stated. In every example I found involving Inpout32.dll it seems that stdafx.h needs to be loaded. I think that is where the cpp related issues began. I did go through the project settings and set the stdafx.h to create the .pch file and have the c file I am working on to use the .pch file like how the example projects do. The error I have been running into is "fatal error C1853: 'Debug/gblast2.pch' is not a precompiled header file created with this compiler"
Chris
|
|
|
|
|
Hello.
Try a "Rebuild All", first of all. If it doesn't work, turn off the use of precimpiled headers.
You can do it either for the entire project or for a specific source file.
If you want to turn it off for a specific file, do this (VC 6):
In "File View", highligt a file. Right-click, select "Settings...".
In The C/C++-tab, select Category Precompiled Headers. Select "Not using precompiled headers". Click OK.
For the entire project, Select "Project->Settings. Do the same operation as before.
This should help. If it works in Debug build, don't forget to do the same for Release build! (A common mistake of mine.)
Good luck.
Kakan
|
|
|
|
|
Thanks again for your help. I did find some information and successfully ran inpout32.dll by means of GetProcAddress (even though I wanted to call the functions like I could in C++) The address of the example is at: http://www.unixwiz.net/techtips/win32-callconv.html
|
|
|
|
|
How do you copy memory using this function?
Suppose you have
PBYTE source1 = new BYTE[2];
PBYTE source2 = new BYTE[2];
PBYTE source3 = new BYTE[2];
PBYTE source4 = new BYTE[2];
PBYTE source5 = new BYTE[2];
PBYTE source6 = new BYTE[2];
PBYTE source7 = new BYTE[2];
PBYTE source8 = new BYTE[2];
PBYTE destination = new BYTE[16];
how can you copy all of the sources into "destination" ?
memcpy(destination,source1,2); // this would copy the source1 into destination
memcpy(destination,source2,2): // this would not start from where the first one ended !! rather it would over write !
Or is there a better method?
-Cindy
|
|
|
|
|
|