|
If you are using Visual studio then you can right click on that macro and select Goto Definition or Goto Declaration . This will take you to the file where it is defined.
Nibu thomas
Software Developer
|
|
|
|
|
I do not know what is the macro name. it could be define at .h file in cpp you can not easily to search.
|
|
|
|
|
I am using NtQueryDirectoryFile function to enumerate all files in a certain folder instead of FindFirstFile and FindNextFile. I just want to see their names so I use this structure
typedef struct _FILE_NAMES_INFORMATION {
ULONG NextEntryOffset;
ULONG Unknown;
ULONG FileNameLength;
WCHAR FileName[1];
} FILE_NAMES_INFORMATION, *PFILE_NAMES_INFORMATION;
how do I translate the "FileName" parameter to an multibyte char or a readble char.
I use WideCharToMultiByte(CP_ACP,0,n->FileName,n->FileNameLength,name,sizeof(name),NULL,NULL);
but the name is not totally translated but only the first 4 or 5 characters.
variable "name" being defined like this char *nume=(char *)malloc(n->FileNameLength);
Can someone please help me with this. it is verry urgent
thanks
gabby
-- modified at 21:20 Tuesday 7th March, 2006
|
|
|
|
|
Use W2A
Nibu thomas
Software Developer
|
|
|
|
|
I get thiese 3 errors
: error C2065: '_lpw' : undeclared identifier
'_convert' : undeclared dentifier
error C2065: '_acp' : undeclared dentifier
the headers i included (from what I ve read about w2a) are
AtlBase.h, AtlConv.h;
I am doing a win 32 aplication not mfc by the way
how should I not get the 3 errors ?
gabby
-- modified at 4:43 Wednesday 8th March, 2006
|
|
|
|
|
When using an ATL string conversion macro, specify the USES_CONVERSION macro at the beginning of your function in order to avoid compiler errors.
Nibu thomas
Software Developer
|
|
|
|
|
You have the right idea here - if you are going to be looping, you might want to stay away from the ATL conversion macros if you are using VC++ 6.0 - those macros dynamically allocate from the stack and you can quickly blow the stack if looping over a good amount of files.
euacela wrote: WideCharToMultiByte(CP_ACP,0,n->FileName,n->FileNameLength,name,sizeof(name),NULL,NULL);
If name is a pointer (and it looks like it is), you cannot use sizeof(...) on it to determine the size of what it points to. Try:
ULONG ulFNLen = n -> FileNameLength;
char *pcFileName = new char[ ulFNLen <code>+ 1</code> ];
::WideCharToMultiByte( CP_THREAD_ACP, WC_SEPCHARS, n -> FileName,
ulFNLen, pcFileName, ulFNLen, NULL, NULL );
pcFileName[ ulFNLen ] = '\0';
delete [] pcFileName; Your malloc(...) example is incorrect, because it does not include space for a terminating NUL character.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
I have a workstation with AMD64 CPU's and 6 Giga Byte RAM ,OS is Windows XP 64 ,and installed Microsoft Platform SDK for Windows Server 2003 SP1.
My problem is:
1.I want to use MFC in vs2003 .net to develope my application,is it possible to use >3G RAM? the app is linked with /LARGEADDRESSAWARE, it can only use 2GB.
2.I use MFC in vs2005 .net, it can not do it too.how to use >3G RAM with VirtualAlloc(),can u help me ,or give me some sample code or detail link site(step by step).
2.there is no option in the vs2005 for AMD64 Platform in "configation
manager" ,why?
thank u very much!
-------
jht
jht
|
|
|
|
|
I have used CListCtrl to create a simple text list, with checkboxes.
What I need to do is to selectively disable an individual item on the list, so that it cannot be selected.
Is there a way through CListCtrl to deactivate an individual list entry? Perhaps by using the SetItemState or SetItemData operations?
Thanks.
|
|
|
|
|
humots wrote: Is there a way through CListCtrl to deactivate an individual list entry? Perhaps by using the SetItemState or SetItemData operations?
Yeah handle item selection event. Maintain an index of disabled entries. If item that is to be selected is a disabled one then de-select it. You can use SetItemState here.
Nibu thomas
Software Developer
|
|
|
|
|
Does anyone have any idea on how one can programmatically prevent another process terminating the process of "my application". I suspect that the terminator ( ) application is using TerminateProcess() and has a handle to the process of "my application" (since it usually creates it) and therefore has TERMINATE_PROCESS security privileges....
I realise that this is usually done for nerfarious reasons by malware/viruses etc but I have a sound business case for doing this (or at least delaying the process termination)
Phil Harding. myBlog [^] | mySite [^]
|
|
|
|
|
Phil Harding wrote: Does anyone have any idea on how one can programmatically prevent another process terminating the process of "my application"
No. If the user account associated with the other application has high enough privileges, it can terminate your application. AFAIK, There's nothing you can do about it. Your best bet is to ensure your application runs as the "Local System" user, but even then an admin will be able to kill it.
Incidentally, those other nefarious (I love that word ) programs don't prevent themselves being terminated, they detect when they are, and then restart themselves. The usually run two processes, and since only one can be terminated at a time by the user, the other one can detect that it has been killed, and restart it. You could take this path, if it only matters that an instance of your program is running. Of course, it won't help if you require the same instance of your program running and not be terminated.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I just installed the VS .NET 2005 Professional and the accompanied MSDN library in FULL. I am using them for a VC++ project and am having trouble with the local Help functionality: F1 help is broken. That is, if I position the cursor over a keyword (for example OnEraseBkgnd) and hit F1, it always displays the topic-not-found page.
Any suggestions appreciated.
|
|
|
|
|
Check your Help settings: Tools->Options, Environment->Help->Online
Try setting it to "Try local first, then online" and see if that works.
--
I've killed again, haven't I?
|
|
|
|
|
I have tried that. The real issue is that sometimes the F1 help works, sometimes not. Any idea?
|
|
|
|
|
Does anyone know how can i find the user name in Windows XP?.
I want to make a programm in visual c++6 that can determine someone's user account name.
Thank you.
-- modified at 16:46 Tuesday 7th March, 2006
|
|
|
|
|
|
Thanks
|
|
|
|
|
using the following, the XML is saved as a single line in the file, and when loaded in either notepad
or VC6, it shows on one line :
MSXML2::IXMLDOMDocument2Ptr pXMLDoc;
pXMLDoc->save( path );
Is there a way to have some line-feed/carriage return so that the text XML is "well formatted" or at least better formatted so that it can be viewed in notepad ?
Thanks.
M.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
The only thing like that I know of is the preserveWhiteSpace property of the DOMDocument object. But I don't think that has any effect if you create a new file from scratch, only if you load and modify an existing file.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Hello folks,
I trying to instatiate a activex control, print template from Internet Explorer. The argv[1] parameter it's a path string to a HTML file(like these: c:\MyTemplate.htm). But it seems the type of vTemplatePath don't match and an exception is launched:
Error on line 474 atlbase.h
Expression: p!=0
I'm sorry to post this question here, but I'm a noob in C++. I'm a web programer(PHP, javascript, action script II), and I need very much of this.
Someone can help me to solve this?
Thanks a lot!
//Microsoft reference
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnie55/html/beyondprintpreview.asp
//code
int main(int argc, char * argv[])
{
int i;
IOleCommandTarget* pCmdTarg;
CComPtr pWB;
CoCreateInstance(CLSID_WebBrowser, NULL, CLSCTX_INPROC, IID_IWebBrowser2, (void**)&pWB);
pWB->QueryInterface(IID_IOleCommandTarget, (void**)&pCmdTarg);
VARIANT vTemplatePath;
V_VT(&vTemplatePath) = VT_BSTR;
CComVariant vPTPath = argv[1];
pCmdTarg->Exec(&CGID_MSHTML, IDM_PRINTPREVIEW, NULL, &vPTPath, NULL);
return 0;
}
|
|
|
|
|
What was the particular string being passed? Formatting, spaces, backslashes can all affect it.
Elaine
The tigress is here
-- modified at 4:43 Wednesday 8th March, 2006
|
|
|
|
|
The string is: "c:\MyTemplate.htm".
|
|
|
|
|
Hi,
I've got a problm with the datagrid. I've changed the datasource of my datagrid to a dataview in order to control this new row that is created when switching between readonly true to false. I am controlling the readonly toggle via a button on the same form. This works fine if I don't touch the datagrid prior to switching the readonly status. However once I have selected a cell in the datagrid and then change the status, it seems like the entire datagrid freezes and I can't do anything.
Any suggestions?
Thanks
David
Think, try, think, think, try, think, think, think, try, ASK, think, try, advance on step and start over...
|
|
|
|
|
I need some help in writing an OPC server. The ideea is that i don't really need to write an OPC server but rather something wich acts as an OPC server. There is an application (that's already running) which is an opc client and i need to add some new data to it. My ideea is to write my own OPC server(simulation ) wich connects to a database at one end and provides the access to the data that the existing application needs at the other end.
I know that what i need is not really an opc server and i have already read the few articles that were posted here (which were of great help in getting closer to my solution) but i really need a few advices on were to go to from here.
Thanks.
|
|
|
|
|