 |
|
 |
Apologies for the shouting but this is important.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
cheers, Chris Maunder
The Code Project Co-founder Microsoft C++ MVP
|
| Sign In·View Thread·PermaLink | 4.00/5 (3 votes) |
|
|
|
 |
|
 |
For those new to message boards please try to follow a few simple rules when posting your question.- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode HTML tags when pasting" checkbox before pasting anything inside the PRE block, and make sure "Ignore HTML tags in this message" check box is unchecked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question in one forum from another, unrelated forum (such as the lounge). It will be deleted.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers, Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
| Sign In·View Thread·PermaLink | 4.11/5 (4 votes) |
|
|
|
 |
|
 |
Hello together, I have simple Win exe that acts as my COM exe server. Unfortunately, I have problems to communicate with it:
The exe is registered in the registry under the CLSID with "LocalServer32". When you launch the Exe, it really shows a window and then waits in the loop while (GetMessage(...)) { TranslateMessage(..); DispatchMessage(...); }
Before the loop I register my COM class, like this: CoInitialize(); CoRegisterClassObject(CLSID_Ixx, (IUnknown*)pFactory, CLSCTX_LOCAL_SERVER, REGCLS_MULTIPLEUSE, dwordthing);
A test within that piece of code, right behind CoRegisterClassObject() is successfull: CoCreateInstance(CLSID_Ixx, NULL, CLSCTX_INPROC_SERVER, IID_Ixx, pIxx); pIxx->myMethod();
BUT: when I do the same out of a separate Console Exe, like: CoInitialize(); CoCreateInstance(CLSID_Ixx, NULL, CLSCTX_LOCAL_SERVER, IID_Ixx, pIxx);
then I receive "E_NOINTERFACE"., although my Win Exe is popping up.
Do you an idea why it cannot find an interface?
Please note the different CLSCTX in both CoCreateInstance() calls above (INPROC_SERVER vs. LOCAL_SERVER). If I change INPROC to LOCAL, it doesn't work either.
Greetings, Joerg
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi Friends, I am sorry if it not the right forum for posting outlook 2007 automation problems.
Here is my problem : I want to add two buttons on the General Section of the Dialog that pops up ,when you click on the name of a contact (from address book).That is when you want to see more details of the person,who sent you the mail , you normally double click on the name of the person. If the person contact is already existing in your contact list a Properties dialog with sections General, Phone\Fax, Company , E-mail Addresses pops up. I want to modify the General section by adding two buttons. I did not find any information on net, related to this. Please let me know,how to go about this ? Thanks
Appu.. "Never explain yourself to anyone. Because the person who likes you does n't need it. And the person who dislikes you won't believe it."
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
i am stuck with one kind of problem when using COM . below are the details , i have written a class which has a com object as a member variable. i have different member function one will create the com object other members will access the functions of the com object. the problem comes when i am trying to access function of the com .
here is sample example of my code
class CMyclass { com variable;
public: void createcomobject(); void accessfunctionofcomobject(); };
CMyclass::void createcomobject() {
::CoInitialize() CoCreateInstance(......); // Every this is fine and i was able to create the com object successuflly .. // every thing is fine and successfull.
// successfull creates com object using cocreateinstance.. and we can call the memebers function of interface variable->method(); // successfully calls the members
}
CMYclass::accessfunctionofcomobject() { // application crashes when try to access com object functions variable->method(); // UNHANDLED EXPECTION }
CMYclass *ptr; // This is gobal pointer variable..
// fun1 is a gobal function void fun1() { ptr->createcomobject(); }
// fun2 is a gobal function void fun2() { ptr->obj.accessfunctionofcomobject(); //calling this funciton makes crash. }
void main() { ptr = new CMYclass(); fun1(); // This function calls creates successful com object inside a class object. fun2(); // This function calls makes crash... }
i want to know why the unhandled exception is raising
modified on Thursday, November 19, 2009 11:53 PM
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Perhaps you are creating the COM object using one interface e.g. IUnknown or IMyInterface1 then, in your method, calling using another interface, say, IMyMethods interface which is not yet initialised? It's a bit hard to say any more without seeing more detail from yourself.
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |
|
 |
I need to check weather the monitor is on or off in windows XP. I had found that, in windows vista it is posible. I have tried it with some .NET languages, VB6 and C++. But nothing works. I have been checking for this from more than a month
I have tried all these stuffs which dose not help me.
WM_SYSCOMMAND and SC_MONITORPOWER raises event only when the monitor is switched off. That too this message is raised only when the application containing this code is set as the active(foreground) window. Where as my application needs to run in background.
GetDevicePowerState - Tried it by passing the handle of monitor which always results with the error code "6" which is "Invalid Handle". As per MS documentation this method wont work for display devices.
Win32_DesktopMonitor - In the Windows Management, I had queried the availability attribute which always resulted "3" which is "Running with Full power".
If their is anything else I had left out without trying, please post it.
Please help me with a code piece or with any refrence to the related articles.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
i did a project that takes datas from the texboxes and open an excel sheet and show the datas in excel. the program works in my pc properly. but when i tried it in another pc it does not work. gave me the error "Row height must be 0 - 255 characters long" what is the problem i didnt find. i load the runtimes of microsoft office to another pc. what was the error or what didnt i do?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi all,
i am using Interop for excel.
i need to set border style as solid and border color for particular cells. am using the following code, which is not working.... Please correct it...
oRange = (Excel.Range)oSheet.Cells[i, j+1]; oRange.Borders.Weight = BorderStyle.Solid; oRange.Cells.Borders.ColorIndex = 11;
Thanks and regards
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
 |
Both of the above books are good. The first is easier reading,...but Don Box, "Essential COM" explains that thinking that motivated the designers. There is an on-line book that covers a lot of the same material as both of the previously mentioned books, Inside COM+[^], to give you a idea of what COM architecture is like. Also, there are quite a few excellent articles about all aspects of COM, reight here at The Code Project.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Ok, so I have been trawling the web to try and find an answer to this, but to no avail.
Basically, I have a DirectShow filter (well 2) which will allow me to configure a Hauppage WinTV USB adapter (though I doubt the specific filter is 100% relevant to answer the question) to use PAL (I) and to set the source as Composite In. So far, I have found ways to display a filter's property page, and to change the settings of a DMO filter, but not enumerate and change the properties of a non DMO source filter.
The reason for needing to do this is that both filter options seem to reset with Windows, meaning that our source becomes NTSC and Tuner In, rather than Pal-I and Composite In. The filters are classed as a Video Capture Source (WinTV HVR-900H Capture) and a WDM Streaming Crossbar Device (WinTV HVR-900H Crossbar), but the ability to change any property of any filter sans a GUI will be a step in the right direction
I am using a .Net wrapper to play with the filter graph through c#, but have limited knowledge of COM interop (thus the wrapper). Any answers in C++ are fine and dandy also, then I'll worry about how to convert them to C#, just in need of an example really.
What's the easiest method to go about this?
modified on Thursday, November 12, 2009 8:53 AM
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
 |
I am using interop for creating excel .. i ve cretaed the excel file. Now i need to hide or delete some of the columns.... Can u plz tell me the code for that...
Thanks in Regardss....
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Just use the Excel object model!!!! To hide column A in the active worksheet, you can use this:
ActiveSheet.Cells(, 1).EntireColumn.Hidden = True
To delete it, use this:
ActiveSheet.Cells(, 1).EntireColumn.Delete
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hey,
I have an in-proc ActiveX control I developed myself. It does not use the standard .CAB based deployment strategy, rather - I have my own setup program, and my own version checking via a website.
Now, imagine the following:
1. User enters the website with an old ActiveX, which is loaded. 2. Website has JavaScript that loads the ActiveX, tells the user that it is old and moves him to a different page with a download link for a new setup program that contains the new ActiveX. 3. User runs the setup program, but cannot upgrade the ActiveX - the OCX is locked by Internet Explorer.
Note that during step 3 there is NO webpage which uses the ActiveX - the download page has no JavaScript at all, in fact.
Does anyone have any tips as to what I can do in such a situation? Or, better yet, does anyone know how to force Internet Explorer to unload an OCX?
Thank you!
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Is there a way to do this without restarting Internet Explorer?
I was thinking of instantiating a specific version of the ActiveX, perhaps via AppIDs. Is this possible?
If I do not have a specific version, I can try and spawn a "generic" ActiveX (with no specific version), and test its version.
Is this feasible?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
One of the basics of ActiveX (COM) is that you can have only one version of a component in a machine. When you register a newer version, the older version is automatically unregistered (leading to what is known as DLL hell).
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
 |
|
|
 |