|
Axonn Echysttas wrote: WHY DOESN'T IT RECEIVE WM_CTLCOLORSTATIC
As steve said where are you writing this code. It should be written inside the wndproc of the parent that holds the static control.
Jesus Loves <marquee direction="up" height="40" scrolldelay="1" step="1" scrollamount="1" style="background:#aabbcc;border-bottom:thin solid 1px #6699cc">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
Yeap, both color changing and text colors changing work now. Thank ya! ::- ).
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
Ok the problem is a lil strange, i am all confused how the hell is this possible, lemme explain with an example...
void Test()<br />
{<br />
CComBSTR bstrOne("abc");<br />
{<br />
CComBSTR bstrTwo("xyz");<br />
}<br />
AfxMessageBox(CString(bstrOne));<br />
}
Now this is what happens sometimes.. when the destructor of bstrTwo is called it calls ::SysFreeString( m_str ) and this free's the string of bstrOne. I have checked the address passed to ::SysFreeString it is the address of bstrTwo.m_str , i just dont understand how the string at bstrOne.m_str is freed. If anyone can explain me this. One more thing it doesn't always happens this way.. It just happens when i copy data on clipboard. The only special thing i am doing is that i have written a custom COM component to handle my Clipboard requests. This actually happens in that code. I understand there is some problem with my code.. but what i dont understand is how does ::SysFreeString(something) frees something else.
:-> WHATEVER :->
|
|
|
|
|
Did you simplify the problem or does it really happen with code that simple?
Steve
|
|
|
|
|
Well actually i simplified it alot.. there are many lines of code there of course. What i am really curious about was that i pass some address X to the SysFreeString and it just frees the string at address Y. I have check the addresses in Memory View and they are different. I am just all confused. The behaviour is consistent in one way, if i have 2 string it will always free the string1 when asked to destroy string2.
|
|
|
|
|
I suspect the problem is in some of the code you edited out. I have used SysFreeString many times and never had any problems like yours. Perhaps if you can produce some code that will actually reproduce the problem you will get a solution.
Steve
|
|
|
|
|
I need to read the line by line data from pdf file...
Plz guide me if u have any ideas.......
|
|
|
|
|
If it's a compressed PDF, as most are, you need to buy or find an external library, or write a whole lot of code yourself.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
if it is not a compressed one..then..
|
|
|
|
|
Then the text in it is just plain text, but it's hardly 'line by line', there's tons of other config info in there as well. You can tell by opening one in notepad and searching for text you know is in there. Not too much tho, even uncompressed ones break the text in the weirdest places.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Petrhaps if you told us a little bit more what you want to do?
|
|
|
|
|
See this[^] document for full doc of the PDF file format.
onwards and upwards...
|
|
|
|
|
Can any body tell me how can i inerface with any COM object? I know GUID/CLSID of he object.
I am new with COM Object.
|
|
|
|
|
The easiest way is to #import the COM object and use __uuidof to generate instances. If you google __uuidof, you're bound to find heaps of examples. Remember, the objects need to be registered on your machine, if you just have been given them as files, you can't just dump them in a folder. regsvr32 is the command line command to register a COM object. If it's installed with something ( like Office ), then this has been done for you.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
There are various libraries that provide classes (and such) to make dealing with COM easier like ATL and the compiler provided COM support classes. Given that you haven't provided much info on this I'll point to at some APIs/interfaces:
CoInitialize - To initialize COM on the current thread.
CoCreateInstance - Create a registered COM object given a CLSID.
IUnknown::QueryInterface - Get an interface on a COM object given its IID.
IDispatch - For dispatch interfaces.
If you're not driving IDispatch interface you will need to have a header file so you can call the methods on the interfaces. There are many ways to do this:
- Use one that comes with the component or SDK
- Use #import
- If you've got an IDL file, use MIDL to make one.
- Use a tool like OleView to make one.
Steve
|
|
|
|
|
But i have no idea of working with IUnknown. I read so much about this interface in MSDN.
|
|
|
|
|
IUnknown has only three methods:
QueryInterface : Get an interface on an object.
AddRef : Call when you copy an interface pointer.
Release : Call when you destroy an interface pointer.
I think you should read a good COM tutorial.
Steve
|
|
|
|
|
Hi,
To start COM application, you have to know some thing about COM and Interfaces.
In VC++, we can do it two ways 1. Using MFC and 2) Using ATL libraries.
ATL is simple and wizard faced. All interfaces creation and registration take care by ATL wizards.
But in case if MFC, you have to inherit a class from CCmdTarget and create a interface also from IUnknown and IDispatch based upon your need.
If you are going to work with on languages like VC++, VB etc then IUnkonwn is enough. But if your COM should support with script languages like VB script, Jscript then You shound use IDispatch.
To create simple MFC COM, please go through the below MSDN link..
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncomg/html/msdn_house2.asp
best of luck
regards
Vallikumar A
|
|
|
|
|
We're making an add-in .dll to inventor.
After a user select some features, for example a circle or some lines, in the whole 2D sketch,we want to show only the selected ones in a dialog at once.
For the selected features may overlap with others ,what we can do to the selected features?
Appreciate for any info
|
|
|
|
|
I foegot to mention that all we do is the development of inventor-a 3D drawing software similar to AutoCAD.
We just use its API to achieve the select function.But don't know about the display thing.
|
|
|
|
|
I have no idea what inventor is. Either way, I'd suggest finding a forum dedicated to coding for it, so you're talking to people who are on the same page as you.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I have a class A, which is a dialog having a CEdit box with CString
variable "m_Edit".
I have another class B having a CString variable "str" declared in it.
Now i want to make a call like this,
CString str = m_Edit;
This is to be done inside class B. How can i get the Edit box value in
class A to class B CString "str".
I tried a few things but couldn't make it work properly.
Can anyone got any suggestions.
Thanks in advance
|
|
|
|
|
easiest way is to define a function in ClassB which accepts a pointer to a CEdit
i.e
<br />
void CClassB::FixEdit(CEdit* pEdit)<br />
Then in that function you can set the text to the string
i.e.
<br />
<br />
void CClassB::FixEdit(CEdit* pEdit)<br />
{<br />
pEdit->SetWindowText(m_str);<br />
}<br />
How you call this up to you - but for example in the contructor of ClassA you could do the following
<br />
CEdit* pEdit = (CEdit*)GetDlgItem(IDC_EDIT1); <br />
<br />
CClassB* cb = new CClassB();<br />
cb->FixEdit(pEdit);<br />
You could make the function static then you would not need to instantiate the CClassB but that's up to you - likewise you could create a function which would take a CEdit pointer and you could then read the contents of the Edit Box instead
|
|
|
|
|
I think your m_Edit variable declared as public. otherwise make it public.
then you should create an object for class A, inside class B.
Like this
A objA;
then do the assignment statement...
CString str = objA.m_Edit;
regards
Vallikumar A
|
|
|
|