|
Hello samfromcn,
It is possible that you have not marshalled the ActiveX's event interface (which contains the FireViewChange() method) to your worker thread.
- Bio.
|
|
|
|
|
Thank Bio,
Someone said that FireViewChange interact with the container, then the container tells the control to redraw. It's a little complicated for me. Now I create a hide window in main thread, work thread send user message to the window, the window call control's FireViewChange. This is easy to implement and it works well^_^.
|
|
|
|
|
Hello samfromcn,
>> Someone said that FireViewChange interact with the container...
Yes, the "container" is actually what we know of as the "apartment". It is a good analogy.
>> Now I create a hide window in main thread, work thread send user message to the window, the window call control's FireViewChange...
This will certainly work. It also works similarly to the actual industrial practice of firing an event from across a separate thread via a proxy to the event interface of the ActiveX marshalled in from the main thread.
However, samfromcn, it is better to learn event interface marsalling in the long run.
Best of luck,
- Bio.
|
|
|
|
|
Using C#, a COM Method uses ref Parameter and it works smoothly, But is it a good principle to use ref Parameters with COM Methods,
|
|
|
|
|
madhankum wrote: Using C#, a COM Method uses ref Parameter and it works smoothly, But is it a good principle to use ref Parameters with COM Methods,
That depends on what type you are referencing. Also, are you calling from C# to COM, or from COM to C#? Either way, is it possible for the data type you are referencing to chang on one side, but not the other?
Nathan
|
|
|
|
|
Hi,
I have a spreadsheet with a worksheet. I have a filter on this worksheet. I want to write a loop and display the data of each cell in each row (for the filtered rows only). I have the following code, but I can't seem to find a solution on how to check the value of each cell in each row:
Dim rng As Range
Dim intRowCnt As Integer
Set rng = ActiveSheet.AutoFilter.Range
intRowCnt = rng.Columns(1).SpecialCells(xlCellTypeVisible).Count
Please can someone help me?
Thanks
Brendan
|
|
|
|
|
[Message Deleted due to spam]
|
|
|
|
|
I don't know for sure, but you could write a Javascript function and call that Javascript function from your Flash snippet.
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Hi, I'm trying to add a custom header for every HTTP request of a IWebBrowser2 instance.
I known that the param Headers of the method IWebBrowser2::Navigate2 allows me to add custom headers but the problem is that it's valid only for the main request and it's not "propagated" for all the related requests of resources (for example).How can I hook every request and alter the headers?
Plz help!
|
|
|
|
|
Hello All,
I'm pretty sure this can't be done, but I don't feel comfortable with that assessment until I put this to you folks. I've been given a standard c# dll that has various financial calculations. It's used via a com wrapper in a visual foxpro app. I've been given the lovely tasks of debugging a slew of errors, but I'm trying to determine the best way to do this. Has anyone made calls from some com app to a .net dll and been able to debug the dll at the same time?
Thanks in advance,
Ryan
|
|
|
|
|
|
I am working on the custom renderer (based on the sampVid),and I am
using the MediaPlayerClassic applciation to test my renderer
The problem I am facing is when I use my renderer when I pause the
video and minimize and maximize the Media player classic I can see my
IVideowindow doesnt repaint the frame back ,right now I am using the
below code in the IvidoeWindow Receivemessages
to black out the Ivideowindow before playback start.
if (uMsg == WM_ERASEBKGND)
{
EXECUTE_ASSERT(GetClientRect(m_hwnd,&ClientRect));
HBRUSH hBrush = CreateSolidBrush(RGB(0,0,0));
EXECUTE_ASSERT(FillRect(m_hdc,&ClientRect,hBrush));
EXECUTE_ASSERT(DeleteObject(hBrush));
return (LRESULT) 0;
}
can any one please help me out how to repiant the paused frame
back ,when I do minimize and maximise on pause
any suggestion will be a great help.
Kesav
modified on Thursday, March 13, 2008 1:21 AM
|
|
|
|
|
Hello
Im new to this place and quite new to windows programming. I want to start to program with directx and I have read somewhere that you'll need to understand COM programming. And I also read somewhere that COM is getting replaced by .NET. Is it better then to learn .NET instead of COM? Or is it better to stick with COM? What is the difference between COM and .NET anyways?
I'll be programming in C++ as I want parts of my application to be portable to linux. Will it be a problem to use C++ with .NET?
Thanks
Karl
|
|
|
|
|
Karl Hansson wrote: Hello
Im new to this place and quite new to windows programming. I want to start to program with directx and I have read somewhere that you'll need to understand COM programming. And I also read somewhere that COM is getting replaced by .NET. Is it better then to learn .NET instead of COM? Or is it better to stick with COM? What is the difference between COM and .NET anyways?
I'll be programming in C++ as I want parts of my application to be portable to linux. Will it be a problem to use C++ with .NET?
Thanks
Karl
If you're using C++ for portability to linux, COM sounds like your best bet. COM provides a binery standard for using native code. .NET is based on a pcode system that is intended to be portable among windows systems.
Nathan
|
|
|
|
|
Thanks Nathan. Do you know of any good COM books to read then?
Karl
|
|
|
|
|
Karl Hansson wrote: Thanks Nathan. Do you know of any good COM books to read then?
Karl
I learned a bit from Inside COM by Dale Rogerson, but mostly, I studied the MSDN library, particularly the COM section and the Visual Studio section. In Visual Studio, the compiler COM support classes are good if you're just using COM objects. ATL is better for making them.
Nathan
|
|
|
|
|
Thanks for your help Nathan
Karl
|
|
|
|
|
Does Linux support COM ?
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
|
|
|
|
|
CPallini wrote: Does Linux support COM?
Not as such. However the OP only needed it for his Windows UI. The Mozilla group did create a cross platform version of COM called XPCOM, which does work on linux.
Nathan
|
|
|
|
|
Hi,
I am trying to set the "User cannot change password" option using ADSI. The code is as follows.
if(PWNoChange.GetCheck() == 1)
{
VariantInit(&var);
CComBSTR sbstrUserFlags = "userFlags";
hr = pUser->Get(sbstrUserFlags, &var);
if(FAILED(hr))
{
AfxMessageBox(_T("Get Failed"));
return;
}
V_I4(&var) |= ADS_UF_DONT_EXPIRE_PASSWD;
hr = pUser->Put(sbstrUserFlags, var);
if(FAILED(hr))
{
AfxMessageBox(_T("put Failed"));
return;
}
VariantClear(&var);
}
When I am running the code , I am getting the message "Get Failed".
Could you plz let me know where I am going wrong?
Taruni
|
|
|
|
|
I have a large application that has a DLL, written initially a few years ago. It is Unmanaged C++ code, a COM object, and the solution that includes the DLL has been migrated to Visual Studio 2005. So far no problem.
A C# .NET 1.1 Class Library was written in VS .NET 2003.
I need to access the above from the Unmanaged C++ COM DLL.
I am using COM Interop
I wrote a C# .NET 2.0 Wrapper class that wraps the C# .NET 1.1 Class Library.
I added a new class to a C++ Static Lib that is linked into the C++ Unmanaged DLL. This class uses COM methods to invoke methods in the C# .NET 2.0 wrapper, which in turn calls the methods in the C# .NET 1.1 Class Library.
I wrote a simple C++ Unmanaged Console app that makes the necessary to call the methods in the C# Class Libraries. This work fine.
When I build the C++ Unmanaged DLL, that has the static lib linked it builds fine. But ever since I added the one class that calls the C# Class Library wrapper, when I try and register, via Add New Component in Component Services, the C++ Unmanaged DLL, the Add New Component hangs after I select the DLL. It does move on to the next window.
The order after I bring up Component Services is Component Services->Computers->My Computer->COM+ Applications->MyAppName->Components->New, etc.
Both C# .NET Class Libraries are in the GAC, and I have run RegAsm on both. I am looking for any ideas on how to debug what is going wrong, tools that may give me an error message, etc.
THX
Scott
|
|
|
|
|
scottdj wrote: A C# .NET 1.1 Class Library was written in VS .NET 2003.
I need to access the above from the Unmanaged C++ COM DLL.
You need to access the C# 1.1 dll from the unmanaged C++ COM dll? This doesn't really make sense.
scottdj wrote: I wrote a C# .NET 2.0 Wrapper class that wraps the C# .NET 1.1 Class Library.
Why do this? It would be better to rewrite the code directly in the C# 2.0 class.
From what I see here you have the following situation:
- Unmanaged C++ COM object
- C# 1.1 library that is called from the unmanaged C++ COM object
- C# 2.0 class that wraps the C# 1.1 class
I think part of the problem you are running in to is the fact that this is running under Component Services, so you don't really have any control over which version of the runtime will be loaded (it will always load the latest version of the runtime, regardless of what version the assembly was compiled against). Also, you can't have one process running different versions of the .NET runtime.
Scott.
—In just two days, tomorrow will be yesterday.
—Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[ Forum Guidelines] [ Articles] [ Blog]
|
|
|
|
|
I didn't write the C# .NET 1.1 Class Library, and am supposed to use as is. So, some of the code I have control over to modify, but not the C# .NET Class Lib.
The order is:
1) Unmanaged C++ COM Object calls
- It imports the typelib from 2), does COM Interop to 2)
2) C# .NET 2.0 Class Library wrapper for the following:
- Calls the methods in 3) directly
3) C# .NET 1.1 Class Library (which I did not write)
Part of the problem was the existing code, which a a global var of a Unmanaged C++ Class, the CTOR was called during the initialization process. I changed that code to not use the global.
I can now register the C++ COM Unmanaged DLL via RegSvr32.exe
It still does not Register via Component Services.
Thanks for the response. Since this involves several different technologies, I didn't know what message board was the most appropriate.
No cross-posting again.
|
|
|
|
|
scottdj wrote: Thanks for the response. Since this involves several different technologies, I didn't know what message board was the most appropriate.
No cross-posting again.
You're welcome. Deciding which forum is the most appropriate for a complex problem can be difficult. If you aren't sure you can always cross post in a way similar to what you did but be sure to include a link to the original post.
That being said, your explanation makes a bit more sense now. A couple of other questions/clarifications:
You are saying that part of your problem was an issue in the C++ code?
You are trying to register the C++ COM object in Componenet Services?
The C++ object calls in to the C# code as part of the object constructor?
You can try running the Assembly Binding Log Viewer (Fuslogvw.exe)[^] to see if that can help shed any light on what is happening on the .NET side.
Also, to simplify things, you can try temporarily changing the COM object to not call the C# code (assuming that it is doing this in the constructor and it's even possible to take these calls out and still end up with a somewhat valid object) and then try to register it. Essentially you want to determine if the problem is in the COM object registration or in the interop calls.
Scott.
—In just two days, tomorrow will be yesterday.
—Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[ Forum Guidelines] [ Articles] [ Blog]
|
|
|
|
|
The C++ Unmanaged DLL has been around for quite a while, it has been register via Component Services many times without problems.
My initial problem was a global class variable in several DLLs that are implicitly linked to 'The C++ Unmanaged DLL' that I am trying to register.
I added code to one of these linked into 'The C++ Unmanaged DLL' call it A.dll for know, to call the C# .NET 2.0 Class Lib Wrapper, via COM Interop, which in turn calls methods in the C# .NET 1.1 Class Lib.
I got rid of the globals. Before I did this A.dll would not register with RegSvr32.exe, and at least I got some error info, i.e., trying to run managed code during the initialization process. Since RegSvr32 has to load A.dll to call DllRegisterServer, it also has to load the implicitly linked Dlls thus getting into the managed code.
After removing the global, I can now register A.dll via RegSvr32, but when I attempt to register via Component Services, it just hangs.
If indeed you have .NET 1.1 & .NET 2.0 code in a Dll it will use .NET 2.0 for everything then I think we have a problem with this in itself. Not necessarily the cause of Component Services hanging trying to Register A.dll. If indeed the code is running the .NET 2.0 Framework, there must be some mechanism to allow running of older components, at least I hope this is the case.
Hope this makes things a little more clear.
THX
|
|
|
|
|