|
Is a LONG 64 bits in Win64 (and in the extension, at the point you try to use it)? A little printf-debugging with sizeof can surely say if it's your code, or if MS once again messed up. My bet is on the latter.
|
|
|
|
|
Hi, in a dialog control , i have 3 sliders, each of them is to do some specific task. I'm aware that everytime i move the slider it calls the message called WM_HSCROLL , and WM_VSCROLL for vertical one. But the problem is how do i identify these controls in the OnHscroll handler? There is a parameter called CScrollBar pointer is passed in too but how do u used this?
Thanks
|
|
|
|
|
tcuong wrote:
But the problem is how do i identify these controls in the OnHscroll handler?
If you use VC6 with classwizard you can define controller for them and identify them whenever you want in your dialog class.
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
how do u do so, i've looked at the classwizard for those control but there r only 3 message which is OUTOFMEMORY, RELEASEDCAPTURE and CUSTOMDRAW. Thanks
|
|
|
|
|
Go to classwizard.(press CTRL+W) Go to Member Variable tab.
In the Class name box, click the CYourclass .
In the Control IDs box, click IDC_YOURID .
In the Category box change Value and then enter name of your control and click ok.With that name you can use your controler.Understand?
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
Hi !
I have the following question : I have 2 machines A and B in the same workgroup and I have a DCOM server at machine A . I'm logging at A and B with different passwords , the probelm is that CoCreateInstanceEx succeds at B but I cannot call any methods of the created DCOM object .(security error 0x80070005)
How could I configure the DCOM sever and Client to work?
I tried DCOMCNFG to allow Everyone to access and launch but it's still not working
Thanks
Jancsi
xxx
|
|
|
|
|
I use a component that returns errors using the ISupportErrorInfo. I create this component inside another component and I can not access the error Description using the code below:
CoInitialize(NULL);
if (FAILED(CoCreateInstance(CLSID_AppSrv, NULL, CLSCTX_ALL,
IID_IAppSrv, (void**)&pAppSrv)))
{
::SysFreeString(bstrInCall);
return;
}
hResult = pAppSrv->DispatchService3(bstrInCall , &vResponse);
if (hResult == S_OK)
*szXMLResponse = vResponse.bstrVal;
else
{
HRESULT hr=S_OK;
IErrorInfo *err;
BSTR str;
hr = GetErrorInfo(0, &err);
if (FAILED(hr))
{
*szXMLResponse = "<error>Unable To Retrieve Error Message";
return;
}
hr = err->GetDescription(&str);
if (SUCCEEDED(hr))
{
CString szTemp;
szTemp = "<error>003 <description>";
szTemp += str;
szTemp += "";
SysFreeString(str);
*szXMLResponse = szTemp;
}
err->Release();
}
Note that GetErrorInfo never fails but GetDescription always fails. Note that this happens when both the components are installed into 2 different packages in the COM+. Also the threading model of the component that produces the error is Apartment while the threading model of the component that fails to access the error is Neutral.
Spiros Prantalos
|
|
|
|
|
What do you do on server side?
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
The STA component is a gate to some services. The Neutral component actually accesses these services. The peculiar case is that if I will take the neutral component outside the COM+ it will retrieve the error info raised by the first component
Spiros Prantalos
|
|
|
|
|
First, you should check for S_FALSE from your call to GetErrorInfo(). S_FALSE means that there was no error info to return.
Second, I don't know exactly what you want. Are you sure the server sets the error info?
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
Ok let me be more specific.
1. I am sure that the component sets the info in the IerrorInfo for 2 reasons:
a. I can receive them and display them from an ASP page
b. I can receive them and display them from the debug program of the second component
as long as the second component is not inserted in the COM+. In other words using
either the debug or the release version of the second component I can receive the
err->GetDescription(&str) never fails. On the contrary when the com is inserted
in the COM+ the same method fails. The error number that I receive in the HRESULT
id -2147417842 and unfortunately does not correspond to a common error code.
2. The whole idea is like this:
COM2<------>COM1<------>SERVICES
COM1 and COM2 live in different packages of the COM+. COM1 is the gate to some
services. COM2 and COM1 are both declared as server in the COM+. COM2's threading
model is Neutral while COM1's threading model is Apartment.
The weird phenomenon in that case is that everything fails only if they are both in the the COM+. Thank you for your time.
Spiros Prantalos
|
|
|
|
|
Hi,
I have a small problem, a question - don't know whether
possible or not.
I have an application (MFC) in VC++, i want to change the
execution of that application. I want that whenever my
Windows machine runs that appl, on start of the
application, I place a Long jump to a position from where
my actual code is executed. (I want a 16 byte empty space)
at the begining of the file (but some fixed sized code
can occur before that 16 byte)
Can nebody help
Sameer
|
|
|
|
|
Something like this:
int main(void)
{
goto end_nop_block;
__asm{
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
}
end_nop_block:
...
}
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanx but actually i'll tell you the whole story...
I have a pogram that takes offset as an input and write 16 bytes of data (character) to the .exe file (like we do in HexDump or neother thing).
So now i want that whenever i compile my .exe the 16 bytes are free at the same offset, so that i can write my own data there.
like if i define char array[16];
So i have to write on this 16 byte
Manually what i am doing is, i am assigning some value to this 16 byte initially and when the program is compiled, i open up my HEX editor and search for this string and write what i want to write.
So, did you understand what i mean, and is this possible
Thanx again
Sameer
|
|
|
|
|
Hi,
I'm using CArchive to copy the contents of one file into another.
How do i know that i reached the end of the file? that is archive??
cfile srcfile,destfile;
carchive arsrc(&srcfile...
carchive ardest(&destfile..
while (????)
{
arsrc >> str;
ardest << str;
}
what shld be in ????
thanks,
ravi.
|
|
|
|
|
try this:
<br />
CFile srcfile,destfile;<br />
CArchive arsrc(&srcfile...<br />
CArchive ardest(&destfile..<br />
unsigned long ulFileSize, ulFilePos; <br />
ulFileSize = srcfile.GetLength();<br />
char copy;<br />
<br />
ulFilePos = 0;<br />
while (ulFilePos != ulFileSize-1)<br />
{<br />
arsrc >> copy;<br />
ardest << copy;<br />
ulFilePos++;<br />
}<br />
|
|
|
|
|
but i don't know the length of copy.
it's not 1 byte at a byte.
I tried using this too..!
while (ulFilePos != ulFileSize-1)
{
arsrc >> copy;
ardest << copy;
ulFilePos += copy.GetLength();
}
but sometimes it doesn't return correct length when it reads spaces
or something else (all in binary format).
any other go??
|
|
|
|
|
Open the files for binary input and output.
Does it work then?
|
|
|
|
|
i tried using CFiles as well.
but when i use this file at a later stage, it retrieves using CArchive
and it gives a problem while reading.
It expects certain string but it archive << str; returns series of strings.
So, i thought of using CArchive initially only.
Any other go?
|
|
|
|
|
Hi
Currently i am programming a shell extension. Everything works nice, except a new dialog. I created a new dialog with the visual editor and used the class wizard to generate a new MFC class for the dialog. But when i try to show the dialog in the InvokeCommand() function with .DoModal() it isn't displayed! But the InvokeCommand() function works well! I replaced the dialog showing code with a message box and it is displayed correctly! But why doesn't the dialog work?
I used the standard call form to show the dialog:
CDisplayInfoDlg dlg;
dlg.DoModal();
but it doesn't work. Anyone knows a solution?
|
|
|
|
|
Does your shell extension contain CWinApp derived class?
|
|
|
|
|
The main class is
class CCryptoCtxApp : public CWinApp
but the class which should display the dialog is
<br />
class ATL_NO_VTABLE CCryptoShlExt : <br />
public CComObjectRootEx<CComSingleThreadModel>,<br />
public CComCoClass<CCryptoShlExt, &CLSID_CryptoShlExt>,<br />
public IDispatchImpl<ICryptoShlExt, &IID_ICryptoShlExt, &LIBID_CRYPTOCTXLib>,<br />
public IShellExtInit,<br />
public IContextMenu<br />
|
|
|
|
|
And what is the return value from DoModal()? DoModal() usually fails, when it cannot locate resources for dialog.
|
|
|
|
|
DoModal() returns IDCANCEL.
|
|
|
|
|
Problem is, that MFC works well within MFC application. Your shell extension is running under explorer.exe and that's not MFC application. DoModal() function can fail for two reasons - cannot locate resources or it is not happy with your main window - explorer window. I had similar problem and I finished with writing my own DoModal() function. I can send it to you this evening, if you want. Try to debug DoModal(), to find out, where it fails.
|
|
|
|