|
Hi
I am using CWindowImpl::create() API which internally call CreateWindowEx() method.
When I test this API of win32 OS. It works fine, but when I test on 64 Bit OS above API failed
|
|
|
|
|
|
GetLastError() value is 1413
|
|
|
|
|
application get crash in CreateWindowEx() function on 64 Bit Windows XP.
Is there any setting required to work CreatewindowsEx() function in 64 Bit windows.
|
|
|
|
|
am 2009 wrote: Is there any setting required to work CreatewindowsEx() function in 64 Bit windows.
No it works the same. The error code you recieved would imply that something may be wrong with the WNDCLASS Structure[^]. Make sure that you are initializing it to zero:
WNDCLASS yourclass = {0};
The error code may also be caused by using a 32 bit DWORD parameter rather than a DWORD_PTR.
Rules for Using Pointers[^]
Best Wishes,
-David Delaune
|
|
|
|
|
how to set a file name in coleinsertdialog class without opening its dialog. I do not want to call its DoModal function which select a file
COleInsertDialog dlg;
dlg.somefunction = "c:/myfile"
//do not call domodal to to select a file
|
|
|
|
|
Hi all,
I have to implement a COM class with VB.NET. An object of this class has then to be created from a VB6 DLL. The code for the COM dll is very simple:
Public Class AdapterWrapper
Implements SchemaCompInterfaces.IEFAdapter
#Region "COM-GUIDs"
Public Const ClassId As String = "58faad86-bbac-4b20-9ab5-fe32bdac0a68"
Public Const InterfaceId As String = "f8dbb078-5f1e-4304-a390-3e8e88983f98"
Public Const EventsId As String = "113d2163-f8db-4d99-88e5-58d13b8d2cf4"
#End Region
Public Sub New()
MyBase.New()
End Sub
Public WriteOnly Property CurrentSPFProjectStatus() As SchemaCompInterfaces.SPFProjectStatus Implements SchemaCompInterfaces.IEFAdapter.CurrentSPFProjectStatus
Set(ByVal value As SchemaCompInterfaces.SPFProjectStatus)
End Set
End Property
Public Function DocumentExistsInTool(ByRef oDocumentIObj As SchemaCompInterfaces.IObject) As Boolean Implements SchemaCompInterfaces.IEFAdapter.DocumentExistsInTool
End Function
Following many more functions from the IEFAdapter interface...
The dll and tlb are created and registered.
The test code for the VB6 client to use this COM class is also very simple:
Private Sub Command1_Click()
Dim adapter As SchemaCompInterfaces.IEFAdapter
Set adapter = Interaction.CreateObject("MyEFAdapter.AdapterWrapper")
End Sub
Now when I'm running this code, I'm getting the Run-time error '13' Type mismatch in the CreateObject line. Late binding with
Dim adapter as Object seems to work for my test code, but is not a solution for me, because I can't change the proprietary VB6 code where the COM object is created. So somehow the interface "SchemaCompInterfaces.IEFAdapter" is not known...
Any ideas how to get close to this problem?
In the project properties I checked the flag for registration with COM-Interop. Perhaps something to do with the ClassInterface?
I'm relatively new to VB, so don't answer too complex...
Thanks in advance!
Alex
|
|
|
|
|
Hi
want to develop 64 bit application for 64 bit windows OS. I tried all VS2005 settings required to compile code in 64 bit. but when I install application , it get installed into C:\programme Files(x86) folder instead of C:\programme Files . Is it necessary to build code on 64 Bit OS.
Thanks
asas
|
|
|
|
|
You can build 64-bit applications on a 32-bit OS using Visual Studio 2005.
Visual Studio uses a 64-bit cross compiler to built 64-bit applications because Visual Studio is itself a 32-bit application.
When installing Visual Studio, this 64-bit cross compiler is not installed by default.
You have to customize the installation and manually select the x64 compiler for installation.
If you're not sure if you've installed the x64 compiler, run the Visual Studio installation again and do a modification to select this compiler.
After the compiler is installed, you can use it by selecting a new x64 configuration from Build -> Configuration Manager -> Active solution platform.
Please note that the target path is different for Win32 and x64 builds.
|
|
|
|
|
Hi
Thanks for your reply.
I did whatever settings required to compile/build 64 bit BHO application.
When i installed this application, it is not get registered with 64 Bit OS and hence no BHO installed on 64 Bit browser.
When i use 32 bit setting for compiling/ building BHO application, it gets perfectly installed. So what may be the reason of not registering BHO application for 64 bit IE browser.
Thanks
abm
|
|
|
|
|
How are you registering the BHO?
Are you using the 64-bit IE?
64-bit BHOs will only be loaded by the 64-bit IE and 32-bit BHOs will only be loaded by the 32-bit IE.
|
|
|
|
|
Hi
Thanks for ur reply,
I used DLLRegister overrided function for registering BHO. I am using 64 Bit IE for this BHO.
Thanks
abm
|
|
|
|
|
Hi
I used DllRegisterServer() overrided function for registering 64 bit COM DLL. I register DLL at Software\Microsoft\Internet Explorer\Toolbar key. It works fine for 32 bit IE, but not work for 64 bit IE. So is there any other key for registering BHO for 64 bit IE.
Thanks
abm
|
|
|
|
|
(kind of a newbie with idl files, so excuse the lingo that could be not so kosher, or if it's more appropriate for the C++ forum)
In our application we generate some COM objects from with "attributed programming" (*)
with VS2008, our main production tool, the generated IDL file contains the following import directives :
import "docobj.idl";
with VS2010, the generated IDL file contains the following import directives :
import "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\wincrypt.idl";
import "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\exdisp.idl";
import "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\shldisp.idl";
import "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\prsht.idl";
import "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\mshtmhst.idl";
import "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\mshtml.idl";
import "c:\program files (x86)\microsoft sdks\windows\v7.0a\include\dimm.idl";
import "c:\program files (x86)\microsoft sdks\windows\v7.0a\include\dispex.idl";
it gives the error :
20> Microsoft (R) 32b/64b MIDL Compiler Version 7.00.0555
20> Copyright (c) Microsoft Corporation. All rights reserved.
20> Processing .\_my_idl.idl
20> _my_idl.idl
20> Processing C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\wincrypt.idl
20> wincrypt.idl
20>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\wincrypt.idl(47): error MIDL2025: syntax error : expecting a type specification or a storage specifer or a type qualifier near "WCHAR"
20>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\wincrypt.idl(47): error MIDL2026: cannot recover from earlier syntax errors; aborting compilation
20>LINK : fatal error LNK1240: failed to compile IDL content
So I have 2 questions :
1 - Who/what decides what imports are to be added in the IDL file ? why should it have wincrypt.idl ?
I manually removed the wincrypt import from the the IDL file and compiled it without problem, but that's not a solution since the IDL is auto-generated.
2 - If it gives error on the WCHAR, I assume it's thinking the IDL is in wide-char mode, even is our application is not ?
(*) for example, see : http://www.microsoft.com/mspress/books/sampchap/6426.aspx[^]
Thanks.
Max.
Watched code never compiles.
|
|
|
|
|
Maximilien wrote: If it gives error on the WCHAR, I assume it's thinking the IDL is in wide-char mode, even is our application is not ?
No, the issue is that it has encountered a line containing a WCHAR directive, but WCHAR has not been defined anywhere. You probably just need to #include <windows.h> at the beginning of your source.
Sorry, I don't know the answer to Q1.
It's time for a new signature.
|
|
|
|
|
How to create and initialize COleDataObject class object.
If i have a character array which contains some data then how to pass this array data to COleDataObject class object.
|
|
|
|
|
i am cretaing a COM object,
aftrer ading reference to a Dll using the add reference dialogue,
i get the error below.
i don't understand what is means and how to solve it.
Error 1 The type 'Sosinpw.SheetStatus' exists in both 'd:\projects\necoscan\necoscan\obj\Debug\Interop.Sosinpw.dll' and 'c:\Program Files\DRS\SKW\Interop.Sosinpw.dll'
thank you.
|
|
|
|
|
It seems that you are referencing two different assemblies, both explicitly or implicitly, and each of them defines a type with the same name and namespace
|
|
|
|
|
Hi.
I develop a context menu shell extension for windows explorer. This shell load when I click on a file or folder, but I need to it load while windows starting and no need user click.
If you can please help me.
Thanks.
modified on Tuesday, July 13, 2010 4:24 AM
|
|
|
|
|
Hello,
I am facing problem while calling CoInitialize().
Here is the sample code:
ABC.exe
=======
for (int i = 0; i < 150; i++)
{
if (!SUCCEEDED(::CoInitialize(NULL)))
{
MessageBox(NULL, "CoInitialize Failed", "Failed", 0);
}
COleMessageFilter* pTempObj = new COleMessageFilter;
BOOL bResult = pTempObj->Register();
::CoUninitialize();
}
XYZ.exe
=======
In XYZ.exe i am invoking ABC.exe for more then 750 times.
After invoking around 500 exes, there is an error for CoInitialize .
If i put a sleep of 1 second in for loop, then there is no error.
I have simulated my problem using the above sample code.
In fact, I am getting error as 0x80070583 and system error as 1411 (Class does not exist).
Thanks in Advance!
Regards,
Tony
modified on Monday, July 12, 2010 12:07 AM
|
|
|
|
|
Hi.
I have a piece of code at client side which calls a method of a COM server to create and return an object. While trying to assign values to data members of this object, I get the following exception - "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
I don't have much exposure to COM so am quite clueless as to how to solve this. Parts of the source are pasted below.
<IDL>
interface _ICallInfo: IDispatch
{
[
propget,
id(1),
helpstring("Call ID")
]
HRESULT CallId([out, retval] LONG *pVal);
[
propput,
id(1),
helpstring("Call ID")
]
HRESULT CallId([in] LONG nCallId);
[
propget,
id(2),
helpstring("Barge Call")
]
HRESULT CallType([out, retval] LONG *nCallType);
[
propput,
id(2),
helpstring("Call Type")
]
HRESULT CallType([in] LONG nCallType);
};
dispinterface _IApplication
{
[
id(3),
helpstring("method CreateCallInfo")
]
HRESULT CreateCallInfo([out]_ICallInfo** piResult);
};
<Client side - a C# client>
public void foo()
{
CallInfo callInfo = null;
CreateCallInfo(out callInfo);
try
{
callInfo.CallId = this.CallId;
callInfo.CallType = (int)this.CallType;
}
catch (Exception ex)
{
//Exception here
}
}
Any help will be appreciated.
Thanks.
|
|
|
|
|
1. What is the actual code for the following function?
HRESULT CreateCallInfo([out]_ICallInfo** piResult);
2. Why do you not check the result of your CreateCallInfo(out callInfo); call to see whether your object was actually created?
It's time for a new signature.
|
|
|
|
|
Richard MacCutchan wrote:
1. What is the actual code for the following function?
HRESULT CreateCallInfo([out]_ICallInfo** piResult);
void CApplication::CreateCallInfo(IDispatch** piResult)
{
CCmdTarget* pTarget = new CCallInfo();
*piResult = pTarget->GetIDispatch(TRUE);
}
I am not sure if you need the source for CCallInfo class so skipping that.
Richard MacCutchan wrote:
2. Why do you not check the result of your CreateCallInfo(out callInfo); call to see whether your object was actually created?
Sorry about skipping that part. I actually do check for that and I am a 100% sure that 'callInfo' has been created successfully. The thing is we have been using 'Reflection' to copy data to 'callInfo' till date. Now we plan to remove that as we are finding it a bit heavy.
Please do let me know if more information is required.
|
|
|
|
|
I notice that the declaration of the CreateCallInfo shows it to return a HRESULT but the implementation is void so there is no way you can check the return value. Also within this function you have no error checks. It may be best to add some more code into your catch block to try and identify which memory pointer is invalid. If this is easily reproducible then the debugger should be the way to go.
It's time for a new signature.
|
|
|
|
|
Caught! I actually don't do that but I knew that there is no problem in creating the 'callInfo' object as I was checking that using the debugger (always reproducible if I don't use reflection to assign values). This is how the function looks like using reflection (which works without a hitch) -
<pre>
public CallInfo CreateCallInfo(ApplicationClass appRoot)
{
CallInfo callInfo = null;
//callInfo = new CallInfo();
appRoot.CreateCallInfo(out callInfo);
try
{
Type typeCallInfo = typeof(CallInfo);
Type typeUCOMCallData = typeof(UCOMCallData);
object[] objValue = new object[1];
foreach (PropertyInfo pi in typeUCOMCallData.GetProperties())
{
objValue[0] = typeUCOMCallData.GetProperty(pi.Name).GetValue(this, null);
typeCallInfo.InvokeMember(pi.Name,
BindingFlags.SetProperty,
null,
(CallInfo)callInfo,
objValue);
}
}
catch (Exception ex)
{
}
}
</pre>
Trying without reflection -
<pre>
public CallInfo CreateCallInfo(ApplicationClass appRoot)
{
CallInfo callInfo = null;
//callInfo = new CallInfo();
appRoot.CreateCallInfo(out callInfo);
try
{
//Type typeCallInfo = typeof(CallInfo);
//Type typeUCOMCallData = typeof(UCOMCallData);
//object[] objValue = new object[1];
//foreach (PropertyInfo pi in typeUCOMCallData.GetProperties())
//{
// objValue[0] = typeUCOMCallData.GetProperty(pi.Name).GetValue(this, null);
// typeCallInfo.InvokeMember(pi.Name,
// BindingFlags.SetProperty,
// null,
// (CallInfo)callInfo,
// objValue);
//}
callInfo.CallId = nCallId; //private member variable
}
catch (Exception ex)
{
}
return callInfo;
}
</pre>
Checking value of 'callInfo.CallId' in debugger gives me this -
callInfo.CallId = 'callInfo.CallId' threw an exception of type system.AccessViolationException'
and the exception described earlier.
Hope this makes it clearer to understand my problem.
Thanks.
|
|
|
|