|
You may also be able to get suitable timing information using the RDTSC instruction. Google for it for more details. If the function will not be running across multiple physical or logical CPUs (its affinity is locked to one CPU, or it is running in a single-CPU system), and will not be running across a sleep/hybernation operation, it should be accurate enough.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> 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! See DeleteFXPFiles
|
|
|
|
|
Hello every body,
I am encountering a problem. I have a piece of code written by some other person. The intention is to display the Protected operating system files in my application, even if the option is checked i-e Organize->Folder and search options-> view and "Hide Protected operating system files". [At the moment I have Vista o/s]
if (pParentFolder->EnumObjects(NULL, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS |
SHCONTF_INCLUDEHIDDEN, &pEnumIDList) == NOERROR)
Above is the already coded line and I have searched there is no flag for o/s files in the structure. I will be thankful if anybody could help me. Thanks in advance.
Best Regards,
Yasir Nisar
|
|
|
|
|
Hello
My application works only with administrative login because it has to access keys under HKLM in the PC and also works on process's to get their information like the process name and its other details.
But though I have an administrative login in one of the PC's the RegOpenKeyEx() API with KEY_READ flag fails to read a particular key under HKLM (a key which is by default present on a PC installed with windows XP)
Also, when I try to open a process using OpenProcess( PROCESS_QUERY_INFORMATION |PROCESS_VM_READ,FALSE, ProcessID), this API fails to open the process inspite of having SE_DEBUG_NAME privilege.
What could be the reason for this? Is it possible that though a user has Admin privileges, access to the registry can be denied?
Thanx.
|
|
|
|
|
What are the error codes?
Do the errors go away if you run the app as an administrator?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi all....
How can I verify the memmory left on a hard disk?
|
|
|
|
|
Use GetDiskFreeSpace, GetDiskFreeSpaceEx .
Regards,
Paresh.
|
|
|
|
|
Arish rivlin wrote: How can I verify the memmory left on a hard disk?
GetDiskFreeSpaceEx[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
This[^] blog entry is interesting when you're into that theme.!
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
I'm using CreateRemoteThread to do some code injections:
taget.exe; load.exe(call CreateRemoteThread); code.dll
I want to use load.exe to call CreateRemoteThread, the thread function is RemoteThreadProc, then in RemoteThreadProc, load code.dll.
But now I have a problem of debugging. How can I see the code runing step by step in RemoteThreadProc()? I can't set a break point there! and then, now can I run the code step by step in code.dll?
|
|
|
|
|
Hi,
I've got a concern about an application which will be installed on different OS version. Target is Windows XP SP2, but may be English, French, Swedisch, German, ...
In this case, "Common files" folder has a different name in those languages...
When I import a DLL from this common files folder, in my English XP, all is fine. But as soon as I run the installer project, this DLL is simply not found and my project fails.
This DLL is part of the installer project (MSI), so I cannot just copy it into my bin directory.
I know I could copy the DLL in my project, but I don't like this idea. I really would like to find a way to link this DLL independantly of the OS language
This is the way I (currently) import the DLL:
#import "C:\Program Files\common files\System\ado\msado15.dll" no_namespace rename("EOF", "EndOfFile")
Any idea?
Thank's
Fred
|
|
|
|
|
Im now reading info about the NSIS (Nullsoft installator) tool http://www.codeproject.com/useritems/NSIS.asp[^]. I recommend you to take a look there, maybe you find something interesting that can help you. They are speaking about languages as well.
And...
BTW, if you want german or other languages... won't you need to include with $ROOT or something like that?
For example in my German windows is:
C:\<big>Programme</big>\Common Files\System\...
So it would not work in my computer like you worte it
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Thank's Nelek,
Actually I didn't find something relevant about my issue. I know well NSIS, as I used to work with it in my former job. This is REALLY a wonderful tool. Unfortunately, my current company uses the installer provided with Visual Studio 2005. Maybe we'll change once
Anyway, by looking furthermore on the net, we have found another solution. Instead of importing the DLL itself, I import the GUID of this DLL. For this to work, of course, the DLL must be registered.
The GUID was found using the OLE/COM object viewer tool from Visual Studio tools.
So, the import look like:
#import "libid:00000205-0000-0010-8000-00AA006D2EA4" no_namespace rename("EOF", "EndOfFile")
instead of
#import "C:\Program Files\common files\System\ado\msado15.dll" no_namespace rename("EOF", "EndOfFile")
Regards
Fred
|
|
|
|
|
BTW, I am starting now with the NSIS to do an installator to my application, as you say that you know it well.
Do you know any site where a step by step tutorial or example is?
I have taken a look into the help file (very complet and good explain) but just definitions and how to, but none example for newbies. I would be thankfull if you can recommend me something.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
|
Thanks, I will take a look. BTW, yesterday I found another link quite good http://nsis.sourceforge.net/Category:Real_World_Installers[^]
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Hi all,
I am having and E_ACCESSDENIED HRESULT at my code at OpenAttach when I try to open an attachment here it is
HRESULT hResult;
enum {CLASS,MSG_PROPS };
SPropValue lpPropValueArray[MSG_PROPS];
lpPropValueArray[CLASS].ulPropTag = PR_MESSAGE_CLASS;
lpPropValueArray[CLASS].Value.lpszA = "IPM.Note";
IMAPITable *m_pAtTable = NULL;
hResult = m_Message->Interface()->GetAttachmentTable(0, &m_pAtTable);
if (hResult !=S_OK)
throw(HResultException("GetAttachmentTable failed in redmap::loopMSg", hResult));
std:tring sName = _T("");
LPSPropValue pProps = NULL;
ULONG cVals = 0;
LPATTACH lpAttach = NULL;
LPSRowSet attachRows;
ULONG ulNumChars = 0;
ULONG lCount = 0;
SPropValue *vals;
LPATTACH attach;
std:tring strAttachmentFilename = _T("");
SizedSPropTagArray(1,g_sptMsgProps) = {1,PR_HASATTACH};
if (SUCCEEDED(hResult = m_Message->Interface()->GetProps((LPSPropTagArray) &g_sptMsgProps, 0, &cVals, &pProps)))
{
if (PR_HASATTACH == pProps[0].ulPropTag && pProps[0].Value.b)
{
static SizedSPropTagArray(6,sptCols) = {6,PR_ATTACH_LONG_FILENAME_W,
PR_ATTACH_NUM,
PR_DISPLAY_NAME,
PR_ATTACH_FILENAME_W,
PR_ATTACH_METHOD,
PR_ATTACH_DATA_OBJ};
if (SUCCEEDED(hResult = m_pAtTable->SetColumns((LPSPropTagArray)&sptCols, 0)))
{
if (SUCCEEDED(hResult = HrQueryAllRows(m_pAtTable,
(LPSPropTagArray) &sptCols,
NULL,
NULL,
0,
&attachRows)))
{
for (unsigned int ctr=0; ctr < attachRows->cRows; ctr++)
{
if(SUCCEEDED (hResult = m_Message->Interface()->OpenAttach(attachRows->aRow[ctr].lpProps[1].Value.l, NULL, MAPI_BEST_ACCESS, &attach)))
{
if(SUCCEEDED (hResult = attach->GetProps((LPSPropTagArray)&sptCols, 0, &lCount, &vals)))
{
if (vals[4].Value.l == ATTACH_EMBEDDED_MSG)
{
LPMESSAGE pMessageEmbAttach;
hResult = attach->OpenProperty(
PR_ATTACH_DATA_OBJ,
&IID_IMessage,
0,
MAPI_MODIFY,
(LPUNKNOWN *)&pMessageEmbAttach);
ULONG lCountSub = 0;
static SizedSPropTagArray(1,sptSubject) = {1,PR_SUBJECT};
SPropValue *valsSub;
if (SUCCEEDED (hResult = pMessageEmbAttach->GetProps((LPSPropTagArray)&sptSubject, 0, &lCountSub, &valsSub)))
{
sName = valsSub[0].Value.lpszA;
hResult = pMessageEmbAttach->SaveChanges(KEEP_OPEN_READWRITE);
if (hResult !=S_OK){
throw(HResultException("pMessageEmbAttach->SaveChanges failed in redmap::loopMsg", hResult));
}
hResult = attach->SaveChanges(KEEP_OPEN_READWRITE);
if (hResult !=S_OK){
throw(HResultException("attach->SaveChanges failed in redmap::loopMsg", hResult));
}
}
if (valsSub)
MAPIFreeBuffer((LPVOID) valsSub);
if (pMessageEmbAttach)
pMessageEmbAttach->Release();
}
else
{
}
}
}
}
}
MAPIFreeBuffer( attachRows );
}
}
}
if (pProps)
MAPIFreeBuffer((LPVOID) pProps);
What do i need to change in this code to make it work? Is this possible? after that will there be further errors to my code? (I have not tested it because I can't get pass the OpenAttach
Thanks,
Jj
|
|
|
|
|
Hi all,
I think this fails because the first attachment number is 0 because the second attachment which has an attachment number of 1 opens successfully, any ideas how this can work?
Thanks,
Jj
|
|
|
|
|
Hello World...
Want to ask how can I create a search keyword code to search in diferrent pages?
For example: I have three personal pages and I search "house" in my main or fourth page how will it search the other three pages I have.. Need your help. Thanks...
-=H=-
|
|
|
|
|
|
I mean any word sir, and can you give me how to do it and c# language. Thanks
-=H=-
|
|
|
|
|
Do you want to search on the html files?
|
|
|
|
|
hi all
i want to allocate memory for two diamentional sring
like CString mydata=new CString[10];
for "TWO DIAMENTION". I done CString mydata=new CString[10][10]; but compiler raise error how can i solve this problem;
thank u in advance
malik
|
|
|
|
|
Try with this
CString *mydata=new CString[10];
|
|
|
|
|
Sorry this is wrong, u have to use CStringArray Class
|
|
|
|
|
Sorry: use a CString* is legal
but you ar right using a CStringArray is best practice :->
Greetings from Germany
|
|
|
|
|