|
Dear friends,<br />
<br />
I am using Windows 2000 Professional & XP 2000<br />
And I want to Access my Hard disk Sectors & Cluster, <br />
I Used CreateFile ("\\\\.\\C:",….) & ReadFile () Functions for read a Particular Drive only Sectors<br />
<br />
I Used CreateFile("\\\\.\\PhysicalDrive0",….) & ReadFile() Function this Cannot work Handle Cannot Create Successfully<br />
<br />
Now My problem is that I want to read MBR & Some Other Starting Sectors of My Hard disk Please Tell me what Can I do for That.<br />
<br />
Advance <br />
Thanks <br />
Shaizi
|
|
|
|
|
I have problem with ATL COM exe
First I build the exe in Win32UnicodeReleaseMinDependancy settings , seems to be allocating 13324 k virtual memory (VM) at startup and then it allocates 1.8 GB which grows up to 1.9 GB of VM
but at the same time exe build in Win32UnicodeDebug settings allocates only 1160 k at startup and allocates 1672k VM , which increases slowly
Previous version of the same exe is working properly (allocating less amount of virtual memory ) and I compared all the project setting of new exe with older one both are same
Can any one suggest me why exe build in
Win32UnicodeReleaseMinDependancy allocates 1.9 Gb of virtual memory ???
|
|
|
|
|
Programming Error? Doing things like abusing dynamically allocated memory (misusing string objects, etc.) will do things like that.
Also, double check for dangling (un-released) interface pointers. For example, I once had an issue with an OleDB object that was getting binary data from a database table. I was not releasing the IStream interface pointer I was getting back, and after about 20-50 records, the memory allocations started to skyrocket!
Behaved completely differently under DEBUG than RELEASE.
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! Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
I've made an OCX control. It works fine OK.
I want to instanciate that OCX when a .fbx file is dropped from file explorer on an Office application ... How can I do that?
Ex: In a PowerPoint slide I want to drop from file explorer myfile.fbx and this will instanciate
my FbxViewer.ocx in the PP slide and myfile.fbx will be loaded into my OCX control.
Thanks
Danny
______
|
|
|
|
|
|
use Component Services in Administrative tools for COM + deployment,
|
|
|
|
|
Dear friends,
I developed an ActiveX control using ATL and Visual C++ 7.0. One function exposed by the control takes too many arguments, around 15 in number. As scuh i want to pass structure instead of too many arguments.
But ATL is not giving me any option to add my structure as an argument ot the exposed function ? Please tell me what is the solution of this problem ?
Also i want to use my control by VB/JAvaScript etc. So what is the better way to solve this problem
Imtiaz
|
|
|
|
|
Scripting languages do not support structures.
|
|
|
|
|
That's like saying "No car can go faster than 200 km/h".
--
Schni Schna Schnappi! Schnappi Schnappi Schnapp!
|
|
|
|
|
Jörgen Sigvardsson wrote:
That's like saying "No car can go faster than 200 km/h".
Brilliant observation! A thousand pardons.
VB Script and JavaScript (the scripts mentioned by the original poster as being pertinant) do not support structures.
Robert
|
|
|
|
|
I saw the references to VBScript and JavaScript after I posted my reply. I knew then that you meant only those script languages.
--
Schni Schna Schnappi! Schnappi Schnappi Schnapp!
|
|
|
|
|
You may have to use safe arrays for this.
« Superman »
|
|
|
|
|
Hi Imtiaz ,
Refer to this article from MS-MSDN.
Building ActiveX Controls for Microsoft Windows Using the Active Template
Library
This article is talking about something, which you are looking for.
As far as VB is concern, it must work !
I dont have much idea about scripting languages
This might ease your difficulties !
Cheers,
Vishal
|
|
|
|
|
Dear Friend,
I tried my best but i was unable to find the article you mentioned. MSDN search is giving me tons of result while i search the topic you mentioned.
Can you please give me the link of this topic.
Thanks
Imtiaz
|
|
|
|
|
|
I need the realization of [b] _variant_t(TEXT("a")) on MASM. [/b]
Or any kind of [b] _variant_t() [/b]
Also I need [b]_bstr_t(urllink) [/b]
Please help if you can!
|
|
|
|
|
Hi
I want to use the MSRdp (Microsoft Remote Desktop control) control from VC windows application but i dont want the control to be visible i want to create it programmatically. i used CoCreateInstance all things goes right and all the functions return S_OK but it doesnot get the session created on server however when i put the MSRdp control on the dialog box and use the same code from there it get connected .... and session is also created on server... Plz reply ASAP
this is the code i used for it
IID IID_RDP =
{0x9059f30f,0x4eb1,0x4bd2,{0x9F ,0xDC,0x36, 0xF4,0x3a, 0x21,0x8F, 0x4A}};
void Connect()
{
::CoInitializeEx(NULL,COINIT_APARTMENTTHREADED);
DISPID dispid =0;
IDispatch* pDisp = NULL;
CString text;
GetDlgItemText(IDC_SERVER,text);
HRESULT hr;
hr = ::CoCreateInstance(IID_RDP,NULL,CLSCTX_SERVER ,IID_IDispatch,(void **)&pDisp);
pDisp->AddRef();
//Setting Username and server
SetProperty(pDisp,OLESTR("Server"),(OLECHAR *)text.AllocSysString());
GetDlgItemText(IDC_USER,text);
SetProperty(pDisp,OLESTR("UserName"),(OLECHAR *)text.AllocSysString());
SetProperty(pDisp,OLESTR("Domain"),(OLECHAR *)"");
//setting password
DISPPARAMS dispparams;
EXCEPINFO escep;
UINT uArgErr =0;
VARIANT Result;
::VariantInit(&Result);
Result.vt =VT_DISPATCH;
dispparams.cArgs = 0;
dispparams.rgvarg = NULL;
dispparams.cNamedArgs = 0;
dispparams.rgdispidNamedArgs = NULL;
OLECHAR *szMem=OLESTR("AdvancedSettings2");
hr = pDisp->GetIDsOfNames(IID_NULL,&szMem,1,::GetUserDefaultLCID(),&dispid);
hr =pDisp->Invoke(dispid,IID_NULL,::GetUserDefaultLCID(),
DISPATCH_PROPERTYGET,&dispparams,&Result,&escep,&uArgErr);
IDispatch *pAdvanced = 0;
pAdvanced = Result.pdispVal;
pAdvanced->AddRef();
GetDlgItemText(IDC_PASSWORD,text);
SetProperty(pAdvanced,OLESTR("ClearTextPassword"),(OLECHAR*)text.AllocSysString());
hr =pAdvanced->Invoke(0x68,IID_NULL,::GetUserDefaultLCID(),
DISPATCH_PROPERTYGET,&dispparams,&Result,&escep,&uArgErr);
BOOL value = Result.boolVal;
//setting startup app
szMem=OLESTR("SecuredSettings");
pDisp->GetIDsOfNames(IID_NULL,&szMem,1,::GetUserDefaultLCID(),&dispid);
hr =pDisp->Invoke(dispid,IID_NULL,::GetUserDefaultLCID(),
DISPATCH_PROPERTYGET,&dispparams,&Result,&escep,&uArgErr);
IDispatch *pSecured = Result.pdispVal;
pSecured->AddRef();
SetProperty(pSecured,OLESTR("StartProgram"),OLESTR("explorer.exe"));
//connecting to server
szMem=OLESTR("Connect");
pDisp->GetIDsOfNames(IID_NULL,&szMem,1,::GetUserDefaultLCID(),&dispid);
hr = pDisp->Invoke(dispid,IID_NULL,::GetUserDefaultLCID(),
DISPATCH_METHOD,&dispparams,&Result,&escep,&uArgErr);
pSecured->Release();
pAdvanced->Release();
pDisp->Release();
return;
}
HRESULT SetProperty(IDispatch* pDispatch, OLECHAR* name , OLECHAR* value)
{
HRESULT hr;
VARIANTARG varg;
::VariantInit(&varg);
OLECHAR* szMem = name;
varg.vt = VT_BSTR;
varg.bstrVal = value;
DISPID dispidNamed = DISPID_PROPERTYPUT;
DISPID dispid;
DISPPARAMS dispparams;
dispparams.cArgs = 1;
dispparams.rgvarg = &varg;
dispparams.cNamedArgs = 1;
dispparams.rgdispidNamedArgs = &dispidNamed;
EXCEPINFO escep;
UINT uArgErr =0;
hr = pDispatch->GetIDsOfNames(IID_NULL,&szMem,1,::GetUserDefaultLCID(),&dispid);
if(SUCCEEDED(hr))
hr =pDispatch->Invoke(dispid,IID_NULL,::GetUserDefaultLCID(),
DISPATCH_PROPERTYPUT,&dispparams,NULL,&escep,&uArgErr);
return hr;
}
|
|
|
|
|
Hi,
can I get help on how to block and realse the ports for Win 98 OS. From msdn i found that ipseccmd is the utility that could be used for Windows XP and Windows2000 to block/release ports. Similraly, is there any utility available for Windows 98? Or is there any other method by which I can block/relase ports for Windows 98(i.e, any registry enry that helps in blocking ports)???????
Thnx in advance
Regards
Uthra
URagav
Everything can be sacrificed for truth, but truth cannot be sacrificed for anything .
|
|
|
|
|
Hello.... have solid, reliable code in C++ that automates Outlook. It has been around for a few years and 99.9% of my users report no problem.
However, occasionally a user reports that they get an error when CreateDispatch() is called. The code is 0x80004002 - No such interface supported.
Sometimes a repair or re-install of the Outlook installation fixes it, most times it does not, and those customers are just out of luck.
Any ideas what might be causing this problem? Of course I can't seem to duplicate it here....
Thanks!
Nicholas
|
|
|
|
|
Hello,
I'm receiving this very peculiar warning, after which my application crashes.
Warning: constructing COleException, scode = severity: SEVERITY_ERROR, facility: FACILITY_WIN32 ($800706BE).
I'm using Windows XP with SP2. The same application works fine on Windows 2000 SP4.
Googling didn't help at all... Hence posting this query here, just if anyone is aware of or has encountered this error and has some solution for the same.
Thanks,
Nirav
* Artificial intelligence is no match for natural stupidity! *
|
|
|
|
|
I think the 800706BE HRESULT code corresponds to
RPC_S_CALL_FAILED
Its defined in winerror.h
Search for this on google.. you might get something. I'll try and find some reason why its not working.
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Hi All,
Does anyone know of a MFC function equilivant to the OleRequestPendingTimeout function used in VB and V FoxPro? This is to prevent the "This action cannot be completed beause the 'file.doc -Micorsoft Word' program is not responding. Choose 'Switch To' and correct the problem" Message from appearing!
Thanks
|
|
|
|
|
I don't know the MFC functions, but I know that the VB which tells "This action..." uses the IMessageFilter interface.
With best wishes,
Vita
|
|
|
|
|
Hi!
I'm trying to implement a event that fires an UDT which contains another UDT. I have some doubts and questions. Here is the idl code:
typedef enum <br />
{<br />
S1_item1 = 0,<br />
}enumSample1;<br />
<br />
typedef enum <br />
{<br />
s2_item1 = 100,<br />
}enumSample2;<br />
<br />
typedef struct<br />
{<br />
BSTR m_string1;<br />
<br />
enumSample1 m_enum1;<br />
enumSample2 m_enum2;<br />
}st_NestedUDT;<br />
<br />
typedef enum<br />
{<br />
s3_item1 = -1,
s3_item2 = 0,<br />
}enumSample_3;
Q1: Is the s3_item1 ok? I read somewhere that enums are finally unsigned short.
typedef struct<br />
{<br />
enumSample_3 m_eS;<br />
<br />
}st_MainStruct
Q2: Should be the nested UDT member a VARIANT or just a st_NestedUDT member?
//------------------------------------------------------------------------
And the event is like:
[id(2), helpstring("method OnNewOrder")] HRESULT OnNewOrder(st_MainStruct stInfo);
And finally, how should I encapsulate the stInfo in order to call Invoke? My first thought was:
IRecordInfo * pRI;<br />
<br />
hr = GetRecordInfoFromGuids(LIBID_MyLibraryLib, 1, 0, 0, IID_st_Main_Struct, &pRI);<br />
if(FAILED(hr))<br />
return hr;<br />
<br />
CComVariant avarParams[1];<br />
avarParams[0].vt = VT_RECORD;<br />
avarParams[0].pvRecord = stInfo;<br />
avarParams[0].pRecInfo = pRI;<br />
<br />
CComVariant varResult;<br />
<br />
<br />
DISPPARAMS params = { avarParams, NULL, 1, 0 };<br />
hr = pConnection->Invoke(2, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, ¶ms, &varResult, NULL, NULL);
Q3: Is that right?
Thank you in advance
Gizzo
|
|
|
|
|
Hello All,
I am new to COM world.
In COM is it possible to have a property with two parameters? For example:
GetValue(index, Value)
PutValue(index, Value)
Does COM allow this kind of definition in IDL file. What are pro and cons of this definition. If i declare a property with two paramters, how I will be able to use it in say C++?
Any one? Any idea?
Thanks in advance,
|
|
|
|
|