|
Dear Experts,
i am using following code to get account expire value.But the output only shows 100 nano seconds from jan 1 1960.
so how to
1.convert the nano seconds into seconds
2.convert the seconds into date
using visual c++
CComVariant svar;
hr =x->Get(CComBSTR("accountExpire"), &svar);
if(FAILED(hr))
{
return hr;
}
// Get the IADsLargeInteger interface.
CComPtr<iadslargeinteger> spli;
long lHigh;
long lLow;
__int64 i64;
// Get the IADsLargeInteger interface.
hr = svar.pdispVal->QueryInterface(IID_IADsLargeInteger,(LPVOID*)&spli);
if(FAILED(hr))
{
return hr;
}
// Get the high and low parts of the value.
hr = spli->get_HighPart(&lHigh);
hr = spli->get_LowPart(&lLow);
// Convert the high and low parts to an __i64.
//__int64 i64;
i64 = (ULONG)lHigh;
i64 = (i64<< 32);
i64 = i64 + (ULONG)lLow;
wprintf(L"HighPart = %u, LowPart = %u, Combined = %I64d\n",lHigh, lLow, i64);
|
|
|
|
|
raja 4 wrote: 1.convert the nano seconds into seconds
You're really asking this?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
Hello Friends,
I am trying to create one vc++ 6.0 application.
In which i have to create two application.
First application is server.
second is client.
server is running on admin user,and sending message to client.
client is getting the text sent by the admin.
client is login in different user in same computer.
########### code use in admin application #############
DWORD dwApp = BSM_ALLDESKTOPS|BSM_APPLICATIONS;
BroadcastSystemMessage(BSF_POSTMESSAGE,&dwApp,UWM_SEND,0,(LPARAM)sSend.GetAt(i));
########################################################
Now i am trying that same thing using MailSlots,
But not succeeded Yet.
So please help me.
Any guys have any idea.
Thanks in advance.
modified on Tuesday, October 13, 2009 12:38 AM
|
|
|
|
|
Not really sure if what you need to do is possible with mailslots, but check if the the client is able to get a valid handle to the mailslot. If not, check the error code.
What are you trying to do here?
Why is it that you want to change your existing working system?
«_Superman_»
I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++)
|
|
|
|
|
The Application which i want to create in not completed with any method of IPC(Inter Process Communication).
So i want help for creating one vc++ application which is running in switch beetween Windows XP users, And communicate with each other.
Thanks in advance.
|
|
|
|
|
I am compiling my code on VS2008,Which was developed using VS20056.But during compilation I am getting this error.
Embedding manifest...
.\WorXTypeLib.exe.intermediate.manifest : general error c1010070: Failed to load and parse the manifest. The system cannot find the file specified.
|
|
|
|
|
shilpi_gupta0708 wrote: The system cannot find the file specified.
I am pretty sure that the system cannot find the file specified. You have some choices:
1.) Copy a manifest file from another project into your current project and name it WorXTypeLib.exe.intermediate.manifest
or
2.) Right click on the project and choose 'Manifest Tool' from the treeview on the left side. Update or remove the manifest from the project.
Best Wishes,
-David Delaune
|
|
|
|
|
Does this help?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi ,Thanks for the reply.But it has the mainfest file at the place , But still not able to load.
Thanks
Shilpi
|
|
|
|
|
need help on minix, does minix 3 support unicode, i was trying to customize its user interfrce. any help will be appreciated
|
|
|
|
|
This forum is for C/C++/MFC questions. You could ask your query on the minix support forum.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
need help how to compile minix 3 using code block 8.2
|
|
|
|
|
i'm trying to learn how to compile it in Visual C++ 2008 Express Edition.
|
|
|
|
|
Hi,
Can anyone please help me to build a graph for input over network using directshow library in C++.
Pritee Kolhatkar
|
|
|
|
|
You should ask a bit more specificly...what exactly do you need help with?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Hi,
I would like to create a COM application using VC++6.0 wherein I require the complete screen to be captured using the PrintScreen (VK_SNAPSHOT) functionality and the output to be printed out (send to Printer). I could use the keyboard event with VK_SNAPSHOT but I failed to send it to the Printer.
Would you be able to advice how to progress here?
With Regards,
Abraham Chethuvelil
|
|
|
|
|
Arun Abraham Jose wrote: I could use the keyboard event with VK_SNAPSHOT but I failed to send it to the Printer.
What is failing (i.e. please post the relevant code)?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Arun Abraham Jose wrote: ...I require the complete screen to be captured...
Does this help?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Very bad sample...
Use GDI+ (5 lines of code) or GDI sample code from MSDN
|
|
|
|
|
It would be helpful if you provided a link when making statements like this.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Thanks Guys,
Let me try this
With Regards,
Abraham Chethuvelil
|
|
|
|
|
i am using this function to get device lists.
void CDeviceList::GetDeviceList(std::vector<string> &info)
{
int i = 0;
HRESULT hr;
CComPtr<ICreateDevEnum> pCreateDevEnum;
hr = CoCreateInstance(CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC_SERVER, IID_ICreateDevEnum, (void**)&pCreateDevEnum);
if (hr != NOERROR)
{
return;
}
CComPtr<IEnumMoniker> pEm;
hr = pCreateDevEnum->CreateClassEnumerator( CLSID_VideoInputDeviceCategory, &pEm, 0);
if (hr != NOERROR)
{
return;
}
pEm->Reset();
ULONG cFetched;
IMoniker *pM;
char* name = new char[255];
char* loc = NULL;
while(hr = pEm->Next(1, &pM, &cFetched), hr==S_OK)
{
IPropertyBag *pBag;
hr = pM->BindToStorage(0,0,IID_IPropertyBag,(void**)&pBag);
if(SUCCEEDED(hr))
{
VARIANT var;
var.vt = VT_BSTR;
hr = pBag->Read(L"FriendlyName", &var, NULL);
wcstombs(name, var.bstrVal, 255);
if (hr == NOERROR)
{
loc = strstr(name,"(VFW)");
if (loc==NULL)
{
info.push_back(name);
}
}
SAFE_RELEASE(pBag);
}
SAFE_RELEASE(pM);
}
delete[] name;
}
I have written a class cDeviceHandler. I want when i start thread it should compare two device lists and display message. code of cDeviceHandler class is given below:
#include "StdAfx.h"
#include "DeviceHandler.h"
CDeviceHandler::CDeviceHandler(void)
{
dList.GetDeviceList(devList);
}
void CDeviceHandler::start(void)
{
startThread = TRUE;
CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadProc, this, 0, NULL);
}
void CDeviceHandler::stop(void)
{
startThread = FALSE;
}
int CDeviceHandler::ThreadProc(LPVOID lpParam)
{
CDeviceHandler* ptr = (CDeviceHandler*) lpParam;
while(ptr->startThread)
{
vector<string> nList;
ptr->dList.GetDeviceList(nList);
char * cDeviceName = new char[260];
int status = ptr->CompareLists(ptr->devList,nList,cDeviceName);
switch(status)
{
case 0: {
TRACE("No Device Arrived nor Removed\n");
}
break;
case 1: {
TRACE("Device Removed \"%s\"\n",cDeviceName);
}
break;
case 2: {
TRACE("Device Arrived \"%s\"\n",cDeviceName);
}
break;
}
delete[] cDeviceName;
ptr->devList = nList;
Sleep(500);
}
return 0;
}
whenever i try to get new device list using
ptr->dList.GetDeviceList(nList);
previous device list is discarded and all member variables of current object are reset. Why is this happening?? can anyone explain it to me?
Regards,
K. Masood
modified on Tuesday, October 13, 2009 12:03 AM
|
|
|
|
|
Use the code block button to the purpose.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
tibbasultanpur wrote:
whenever i try to get new device list using
ptr->dList.GetDeviceList(nList);
previous device list is discarded and all member variables of current object are reset.
Is this happening via your code? If so, just set a breakpoint on the "discard and reset" code. Learn to use the debugger. It'll quickly help to narrow the problem to just a handful of lines.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|