|
CString can only be used in C++ programs. If you can afford it, change the extension of your file to .cpp .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I created my first ATL COM inprocess server, and successfully invoked methods in a VB client. But when i try to integrate it into my ASP script, I got the following error when pointing the URL at my ASP page:
Error Type:
Server object, ASP 0177 (0x800401F3)
Invalid ProgID. For additional information specific to this message please visit the Microsoft Online Support site located at: http://www.microsoft.com/contentredirect.asp.
/GenJoin.asp, line 7
My ASP script looks like this:
<% @Language = "VBScript" RUNAT=Server %>
<title>GenSQLJoin
Sub Session_OnStart()
Set SQLJoinEngine = Server.CreateObject("ATLFIRSTPROJLib.MyATLServ") THIS LINE IS CAUSING PROBLEM: Invalid ProgID
...
... other stuff...
...
QUESTION 1: how can i determine the progID for my ATL COM server? To help out:
1. my ATL project name: ATLFIRSTPROJ
2. Class: CMyATLServ
3. Interface: IMyATLServ
As mentioned, I already successfully invoked the server from a VB client:
Private Sub btnAdd_Click()
Dim objTestATL As ATLFIRSTPROJLib.MyATLServ
QUESTION 2:
(a) I dont understand the syntax here. We have class name = CMyATLServ and interface name = IMyATLServ. BUT nothing = MyATLServ
(b) My project name is ATLFIRSTPROJ. What's the "LIB" at the end of "ATLFIRSTPROJLib"?
Set objTestATL = New ATLWhore
Dim lngReturnValue As Long
objTestATL.SomeMethod Me.txtNum1, Me.txtNum2, lngReturnValue
Me.txtNum3.Text = lngReturnValue
End Sub
Thanks!
norm
|
|
|
|
|
The ProgID can be determined both by looking at the registry or looking in your .RGS file
You're probably having a bug in VC 6.0 without any service pack. It had a bug when creating an ATL COM component and the default ProgID of your project probably is ATLFIRSTPROJLib.MyATLServ.1
Apply the Service Pack 5 of Visual C++ to solve this and other bugs.
lazy isn't my middle name.. its my first.. people just keep calling me Mel cause that's what they put on my drivers license. - Mel Feik
|
|
|
|
|
why did u say "You're probably having a bug in VC 6.0 without any service pack."
anyway, i am checking up on what u just advised now... will get back later.
thanks again.
norm
|
|
|
|
|
hey man, i think i just got it working =)
i looked at the rgs file and get the progID. thanks for the advice.
norm
|
|
|
|
|
Just wondering what u meant when u recommended SP5. i am having installation problem (on SP5) and not sure if i should download the service pack coz it doesnt say anything about bug fix on ASP/ATL-COM. Here's the link.
http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q280367&
anyway, i thought i got it last nite. I think i successfully CreateObject.
but i am getting the following error now:
Error Type:
Server object, ASP 0177 (0x80004002)
No such interface supported
/AddNumber_action.asp, line 16
can u elaborate a little more on rgs file? and also, there's nothing in the regisrty that says "progID"... just a bunch of GUIDs.
Thanks
norm
|
|
|
|
|
I'm not sure in which specific Service Pack it was fixed, I recommended the SP5 because it's the latest one and carry all the fixes the previous SP had.
But, as I've said, it will fix THE WIZARD, so, only new projects will be affected by it.
lazy isn't my middle name.. its my first.. people just keep calling me Mel cause that's what they put on my drivers license. - Mel Feik
|
|
|
|
|
Hi.
I was wondering if anybody can tell me how to get the mouse cords while it it over an owner drawn button..
I'm getting the WM_MOUSEMOVE while its over the main dialog, but as it goes over any button it dosn't get the message.
what I am trying to do is make a simple bitmap font editor, and I was thinking of using a button to draw the grid for editing the graphic.
I'm not using MFC (its all H handles (HWND, HBRUSH etc..)
many thanks.
Chris
|
|
|
|
|
I haven't used it, but I need to do something similar, take a look at this article that talks about TRACKMOUSEEVENT.
http://www.codeproject.com/buttonctrl/hoverbutton.asp
I don't know if the sample is right or not, but trackmouseevent could be your starting point to solve your problem.
hope this helps...
|
|
|
|
|
Thanks for the link, but it only gives you events when the mouse enters or leaves the button...
I want to be able to get the mouse cords in relation to a window..
its either that or can somebody give me an idea of a control to use to render the grid.. owner draw buttons work really well for that as you can draw everything yourself.. the static frame, rectangle even if you get the DC for the object don't change if you draw drectly to the DC..
Cheers
Chris
|
|
|
|
|
I know this is the wrong thread, but I only got a response on ATL in the other thread....
Are there any special requirements/dlls/etc. that your users computers need if you implement ATL / WTL / STL ? New to this area.
I am thinking of trying it out, and pointers would help. Thanks
"Best file compression around: DEL *.* = 100% compression."
<><><><><><><><><><><><><>
Matthew R. Miller
mattrmiller@computersmarts.net
www.computersmarts.net
|
|
|
|
|
ATL: Not if you use the MinDependency build target, which is recommended due to hassles with atl.dll (there are two builds, one for 9x one for NT, and there are backward-compatibility issues).
WTL: WTL itself needs no DLLs, however it is an extension to ATL.
STL: Uses the CRT, so you can either link the CRT in statically (again, the recommended way) or redistribute the CRT DLLs (ugh!)
--Mike--
"alyson hannigan is so cute it's crazy" -- Googlism
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
never used WTL.
for STL, you really don't need anything else.
for ATL, you might need something, depending on what your app does: if you do database stuff, you might need MDAC, etc.. but, in general no, you don't need anything unless you build "Min Size" builds, then you have to ship with a (very small) ATL dll.
-c
“losinger is a colorizing text edit control”
-- googlism
|
|
|
|
|
If I have these below data (base 256)
<br />
data[0] = 154;
data[1] = 203;
data[2] = 15;
data[3] = 54;
data[4] = 248;
data[5] = 175;
and I want to change data(base 256) to Ctring which have format in base 16 character
<br />
CString m_data;<br />
m_data = "9ACB0F38F8AF";<br />
Do you know how to do that?
Thank you for your answer.
|
|
|
|
|
You can do something like this, assuming data is some kind of integer type:
<br />
CString m_data;<br />
m_data.Format(_T("%X%X%X%X%X%X"), data[0], data[1], data[2], data[3],data[4],data[5]);<br />
- Anatari
|
|
|
|
|
Assuming data is an array of int :
m_data.Format ( _T("%02X%02X%02X%02X%02X%02X"),
data[0], data[1], data[2],
data[3], data[4], data[5] );
--Mike--
"alyson hannigan is so cute it's crazy" -- Googlism
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Actually what you have is a decimal number (Base 10) where the maximum value is 256, and you want to convert that to a hexidecimal or Base 16 number.
You should be able to use the Format member function of the CString class to convert each byte for you.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Thank you for your answer.
|
|
|
|
|
I have an MDI program. One of the dialog boxes carries out some calculations and writes them to a file. I would like the program to open the file automatically. The file name will be known. The user defines it in the dialog box.
Thanks
I feel more like I do now than I did awhile ago.
|
|
|
|
|
This is a basic operation with iostreams - I have articles on CP, the MSDN has info also, as does google.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
The MDI program is a text editor. I would like the file to be visable as if the user had opened it with the file open dialog box. Is this still covered with IOstreams?
|
|
|
|
|
Absolutely - an ifstream will read your file in no worries, and then you can just set up your editor to contain the data read in.
something like
std::ifstream a(szFilename);
std::string s;
while (getline(a, s))
MyInternalBuffer += s.c_str();
You need to include string and fstream for this to work.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
How do I set up the editor to contain the data? that is where i am having problems. I have no problem reading the data into the buffer.
I thought maybe I could
CMyDoc* pdoc;
pdoc.OpenFile( CString path );
I have searched my books on Doc/View architecture. I am sure the answer is there but I don't see it.
Thank You
|
|
|
|
|
kjessee wrote:
How do I set up the editor to contain the data?
Oh - the problem is not loading, it's actually having the text in the editor ? There are many ways to go about this, the simplest is to use a CEditView ( from memory ) and call SetWindowText on it.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Has anybody tried to put a bitmap background on a CRichEditView?
I've tried to use GetRichEditCtrl().ModifyEx (0, WS_EX_TRANSPARENT) and it did give me a transparent background CRichEditCtrl. However, I can't paint the background of the view!
How come ON_WM_ERASEBKGND message is NOT sent to the CRichEditView?
Any help will be appreciated.
Thanks,
Duc Truong
In programming you can do anything (by Paul DiLascia)
In programming you can do anything (by Paul DiLascia)
|
|
|
|