|
Jeez, I heard the slap all the way over here. You alright?
BW
{insert witty/thought-provoking saying here}
|
|
|
|
|
Are you from out of the country?
--BlackSmith--
/*The roof is on fire, we don't need no water, let the MF burn*/. BHG.
|
|
|
|
|
Oh .. sorry ..
I'll tryed to parse file as you said ... it works well.
Thanks.
|
|
|
|
|
GetPrivateProfileSection() works better? If so, silly me... I'm always trying to invent the wheel
I'm so high...
--BlackSmith--
/*The roof is on fire, we don't need no water, let the MF burn*/. BHG.
|
|
|
|
|
I have written a class in a seperate file which I want access to the statusbar. How do I change the message in the statusbar from this class? I have included the "stdafx.h" in the class I defined.
|
|
|
|
|
If what you want is a value being displayed in the status bar (like coordiantes in a picture-editor), try this:
You set a variable in your CDocument class.
This variable is then displayed via a ON_COMMAND_UPDATE_UI-handler in either your main frame or your view.
|
|
|
|
|
Thanks for your reply, jhwurmbach!
I think I have to repharase my question. I have written a class method which does all the screen output, but the output is onto the screen via "cout". Now, I am trying to rewrite this class such that I could output my message onto the statusbar in windows instead. I understand that "CView" is the one that handles the output in windows. I am trying to change my original DOS-output class to a windows-output class one. I hope u can understand what I am trying to say. U have any suggestion?
|
|
|
|
|
You don't want to simplay have a 'logging' style output in a Window (for that, try searching the site), you want to show one output line in the status bar, right?
Do we talk about the same 'StatusBar'-thing?
I talk about he same bar that in IE contains the little globe and the 'Internet' text at the right bottom of the window. in the same bar, with SSE-connection, a little yellow lock shows up.
So, probably it is really easiest to let your class-method set a variable in the dochument and show that variable via ON_UPDTE_COMMNAND_UI.
|
|
|
|
|
AfxGetMainWnd()->SetMessageText();
...make it about Visual C++, and don't ever mention Visual Basic. Nick Hodapp (MSFT) in Semicolon[^]
|
|
|
|
|
Thanks for your reply. I have tried to use that statement u mention. It can't work, apparently SetMessageText is not a member of AfxGetMainWnd().
|
|
|
|
|
I have a VB dll, and a VC client. In this snippet of code from the client :
BOOL _CRemoteCall::MoveProgressBarX(long hPBHWND, long iMin, long iMax)
{
BOOL result;
static BYTE parms[] =
VTS_I4 VTS_I4 VTS_I4;
InvokeHelper(0x60030002, DISPATCH_METHOD, VT_BOOL, (void*)&result, parms,
hPBHWND, iMin, iMax);
return result;
}
how do I get that number 0x600.....? I think what the call does is it calls a particular function from the VB dll, but I just cant figure how out to get that number. Also I hope this number isnt machine specific (just cant be because its hardcoded...)
Thanks,
ns
|
|
|
|
|
It's the DispID of the VB Object, it won't chang from machine to machine..
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Okay. thanks. I dont know how to get this DispID. Is there a procedure outlined somewhere that you know of? Is is somethin that can be answered in a post without too much trouble ?
Thanks,
ns
|
|
|
|
|
That depends... The only way I know is using the #import statement to import the dll. Then, in the .tlb-file generated by VC, you can see some const's called IID_SomeName. That's the ones you want
Hope it helps...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
You can use OLE View that comes with VC++ 6.0. You open a typelib, select the appropriate interface (probably an IDispatch-derived one).
Browse through the methods and you'll notice ids.
If a train station is where the train stops, what's a workstation...?
|
|
|
|
|
Wonderful! Thats exactly where I found it (for the sample) after you directed me. APpreciate it!
Then I looked for a tlb in my VB prj folder and there wasnt one! So I have to locate a tlb file for my prj. Wonder if you have to tell VB to make it...
Thanks,
ns
|
|
|
|
|
DLLs usually incorporate the TLB as a resource. OLe View can read those as well. Just load the dll (or exe) instead.
If a train station is where the train stops, what's a workstation...?
|
|
|
|
|
I need the complated path to load a library, this library is in the same place that the executable, I see the class CWinApp, but this class doesn´t give me the complated path. Also i have changed the path with m_pszProfilePath but it doesn´t work.
thank in advances.
|
|
|
|
|
::GetModuleFileName()
...make it about Visual C++, and don't ever mention Visual Basic. Nick Hodapp (MSFT) in Semicolon[^]
|
|
|
|
|
Use GetModuleFileName()
If a train station is where the train stops, what's a workstation...?
|
|
|
|
|
hi all,
can u tell me how to convert a BSTR to char(i want to display the bstr value)
|
|
|
|
|
Use the OLE2T() macro.
Look! They have the Internet on computers now! (Homer J. Simpson)
|
|
|
|
|
Or assign it to a CString, or use _bstr_t
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
e.g BSTR bstrValue
_bstr_t bstrTemp(bstrValue);
CString sValue = (LPCTSTR)bstrTemp;
|
|
|
|
|
Use MAKELONG(hAtom, 0) where hAtom is your ATOM value you got from RegisterClassEx.
Look! They have the Internet on computers now! (Homer J. Simpson)
|
|
|
|