|
Ok, long time no ASP but...
1. Did library register correctly? Verify with regsvr32 <filename>
2. Is the typelibrary needed and if so is it compiled and registered?
Merged or separate?
|
|
|
|
|
thanks for the feedback. I've got my server properly registered.
it's a simple method that add two numbers:
STDMETHODIMP CATLStringParser::AddTwoNum(long Num1, long Num2, long *ReturnVal)
{
// TODO: Add your implementation code here
*ReturnVal = Num1 + Num2;
return S_OK;
}
But i am not sure how to make the ASP call:
<%
Set obj=Server.CreateObject("StringParser.ATLStringParser")
some_num = obj.AddTwoNum(10, 2) //PROBLEM HERE!
%>
<title>
Test simple ATL ActiveX control server.
... some processing ...
For some reason, I keep getting:
Error Type:
Microsoft VBScript runtime (0x800A01C2)
Wrong number of arguments or invalid property assignment: 'obj.AddTwoNum'
/MyCookiesServ.asp, line 3
I've tried a few things already:
some_num = obj.AddTwoNum(10, 2)
obj.AddTwoNum(10, 2, some_num)
none worked. Help!
norm
|
|
|
|
|
Okay, now I've done it. Not sure what, but hopefully some one here has some suggestions. I'm using version 6 on NT 4, btw, and have VSS integrated. Everything works perfect except when I use my network login. Other people login to the machine, and the program runs fine and loads any and all projects perfectly. If I use the local administrator account, again all works fine. But when I use my own account, msdev.exe brings up a Dr. Watson while the splash screen is still being displayed. I suspect that there must be some special registry settings that are user specific that are causing the problem, but I can't seem to locate the one causing this problem. I welcome any sugggestions from those with more registry knowledge.
I think I started this problem by executing the debug version of a program by double clicking it from an open explorer window. While this was running, I then tried to start up msdev and it would have attempted to load the workspace that contained the project that builds the executable that I was already running. This produced the very first crash. Even after power off's and restarting, it continues to crash, but only when I logon using the id that I was logged on as when the first crash occurred.
Thanks for any hints.
Chris Meech
[EDIT]
I finally found a registry entry
HKEY_USERS\..GUID-for-me..\Software\Microsoft\Devstudio\6.0
that I renamed to 'keepthis'. Following this, msdev would no longer crash. Now for the kicker. A new entry called 6.0 was created, which I promptly renamed, and the entry called 'keepthis' was now renamed back to 6.0! I was expecting msdev to now crash, but it didn't and it is now working like a champ and I have all my preferences, etc. all set as usual. Go figure.
[/EDIT]
|
|
|
|
|
Does it crash even when not loading up that particular workspace? Is so then I think you are looking at a re-install
Cheers
James
|
|
|
|
|
That's correct. When I even try to open other projects or workspaces, it still crashes. The most unusual thing though is that it all functions fine, when I login as some other user. I'm still going to do some more registry hunting before I do a re-install.
Thanks.
Chris Meech
|
|
|
|
|
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
{
... // all the window initializations
wndclass.hInstance = hInstance;
...
hInst = hInstance // global handle to instance
...
}
LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
...
WM_CREATE:
LoadIcon(hInst, MAKEINTRESOURCE(IDC_REEL));
...
return 0;
...
The icon will load in every other place in the program except for WM_CREATE (The only place where I need it to load so I can place it on a button)
I get the error: 1813 (The specified resource type cannot be found in the image file.) Even though it exists because I can load it everywhere else...what am I doing wrong here, please someone I need help!
|
|
|
|
|
I don't really see the problem with the code. Perhaps a misspelling: IDC_ instead of (more common) IDI_? Have you tried passing NULL instead of hInst (assuming IDC_REED resides in the main exe)?
I assume the CreateWindow of the main window is called after the line hInst = hInstance; .
/moliate
The corners of my eyes catch hasty, bloodless motion -
a mouse?
Well, certainly a peripheral of some kind.
Neil Gaiman - Cold Colours
|
|
|
|
|
Thank YOU!!!!!!!! I had hInst = hInstance after CreateWindow was called...can you explain to me why it works when put before and not after?
|
|
|
|
|
One of the first tasks CreateWindow do is putting a WM_CREATE message on the queue. This means you probably call LoadIcon in the messagepump before hInst is set to a valid value - it could be anything...
Cheers
/moliate
The corners of my eyes catch hasty, bloodless motion -
a mouse?
Well, certainly a peripheral of some kind.
Neil Gaiman - Cold Colours
|
|
|
|
|
I struct a frustrating problem.
An application that is now in its 7th version and has never exhibited this problem before has suddenly decide to hide behind visual studio if launched from there or explorer if launched from there. Also the taskbar flashes indicating it is inactive.
No changes have been in either the Application's InitInstance or the Create and PreCreateWindow functions of the Main Frame. It is of cause obvious that something has changed in the project somewhere.
Any suggestions as to where I can look will be welcome. The problem seems to 'worst' on XP.
|
|
|
|
|
I'm having a problem deleting objects I've created with the new operator. I have two classes: Particle and ParticleExplosion. ParticleExplosion has:
vector< Particle * > pL
Inside the constructor to the ParticleExplosion class, I make a whole bunch of Particles and put pointers to them in a vector ( pL ):
ParticleExplosion::ParticleExplosion()
{
for( i = 0; i < this->numParticles; ++i )
{
p = new Particle;
pL.push_back( p ); // pL is a vector
}
}
When a ParticleExplosion object gets destroyed (by going out of scope), it's not taking the objects the pL points to with it (which I expected). So, I made my own destructor for ParticleExplosion, where I step through the vector, and delete each item that it poitns to:
ParticleExplosion::~ParticleExplosion()
{
for( int i = pL.size(); i > 0; --i)
{
delete this->pL[i]
}
}
After deleting the first item, the program crashes. Am I going about this the right way?
daniel@jurnove.net
|
|
|
|
|
Why this->pL[i], instead of just pL[i] ? I'd use an iterator to do this, rather than a loop, but I don't think that matters. Actually, I have a functor that I call with for_each that just deletes the pointers in a vector.
I don't see what the problem is, but I'd suggest ditching this - maybe the compiler can't handle this in a destructor.
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
|
|
|
|
|
You need to delete each member like :
class MyClass
{
public:
MyClass();
~MyClass();
int m_iIndex;
};
std::vector<MyClass*> myClassVector;
for (int i = 0 ; i < 10; i++ )
{
MyClass* p = new MyClass();
myClassVector.push_back(p);
}
std::vector<MyClass*>::iterator it = myClassVector.begin();
while ( it != myClassVector.end() )
{
delete (*it);
++it;
}
Max.
|
|
|
|
|
Hello,
I just installed Visual studio installer.. I created my package and it works fine, I created a short cut in START->Programs->MyApp->MyApp.exe except that I can't find any way to set the "Start in" field for the shortcut.. my program depends on some ini's that are in the same folder as the main.exe.
Any ideas?
|
|
|
|
|
Ya know how the date control pops a calendar?
And how the combo control pops a listbox?
How do I make a control like a tree control or multiline edit control
pop from a button press or static click?
Should I put the tree control in a dialog and bring up the dialog
upon a button press?
Or should I just dynamically create a tree control?
On the one hand, I don't want a dialog border if possible, but
I also don't want the tree control to get clipped.
And I'd like the popup tree control to go away once the mouse is
outside it's rectangle.
Can any of you ole hands at the win32 api tell me which messages to
listen to, etc? And whether to pop a dialog with control or just
the control?
And what should I listen to to tell if the popped control needs to
go away?
If you can point me to a specific demo project here on codeproject,
that'd be cool. But I've been thru most of em and they all have
funky things about them that don't behave nicely...:/
Any help you can lend will be MUCH appreciated
...Steve
|
|
|
|
|
This might be a simple question but it seems I can't find the answer with the online help.
I just upgraded from Visual C++6 to Visual .net pro. I am only using the C++ compiler for the time.
I can't find the equivalent of the profiling tool allowing for the timing of functions. (the purpose being to optimize). This is a basic requirement when coding so I assume that it still exists in the new version.
Thanks for any feedback
Eric
|
|
|
|
|
Actually no. Visual C++ .NET and Visual Studio .NET do NOT ship with a profiler. However, there is a coupon in the box that enables you to download a trial version of a Compuware profiler.
We're trying to figure out how to get a decent profiler back in the box -- I'm certainly aware that profilers are a core tool for C++ devs. But the one that used to ship with Visual C++ was deemed insufficient to work with Visual C++ .NET and we decided to abandon it.
Sorry - I know this isn't the ideal situation for you.
Nick Hodapp
This posting is provided “AS IS” with no warranties, and confers no rights. You assume all risk for your use. © 2002 Microsoft Corporation. All rights reserved.
|
|
|
|
|
Thanks Nick for the quick response!
It's nice to see some MSFT people looking at forums.
I am also sad to find out about the missing profiler. Despite the fact that the Visual C++6 profiler was not too great, it was nevertheless usefull to quickly find out bottlenecks. I have uploaded the Compuware profiler community edition. I hope this will do the trick.
Note that I am working on my own tool to post-process computational fluid dynamics results (10+ millions triangles on cut surface displayed with OpenGL). Optimizing is therefore very important.
I sincerely hope that some kind of profiler will be added later on to the studio tools.
I would also add to the list of features: openMP for C++ ... which is much easier to use for parallel processing than the threads.
I know that Intel C++ has it. Is this compiler compatible with the MFC libraries and visual .net environment?
Thanks
Eric
|
|
|
|
|
I get linker errors when I try to do this, do I have to use a #pragma or something?
#include <iostream.h>
#include <afx.h>
int main()
{
CString c;
return 0;
}
Error:
--------------------Configuration: test - Win32 Debug--------------------
Linking...
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
Debug/test.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
test.exe - 3 error(s), 0 warning(s)
Nick Parker
May your glass be ever full.
May the roof over your head be always strong.
And may you be in heaven half an hour before the devil knows you’re dead. - Irish Blessing
|
|
|
|
|
If you are using MS Visual Studio, go change your project setting to "Use MFC in a Shared DLL."
|
|
|
|
|
Boogie wrote:
If you are using MS Visual Studio, go change your project setting to "Use MFC in a Shared DLL."
Ah, that works fine, but is there a way to do this directly in code alone so the setting is still listed as "Not Using MFC"? Thanks for the response by the way.
Nick Parker
May your glass be ever full.
May the roof over your head be always strong.
And may you be in heaven half an hour before the devil knows you’re dead. - Irish Blessing
|
|
|
|
|
I am not sure about that. CString is a MFC class. That's the reason I ask you to change the project setting. Your other option is to use char type.
Maybe someone else can help you.
|
|
|
|
|
Boogie wrote:
Your other option is to use char type.
I know I can use other data types to do this, however I wanted to do this specifically with a CString . Thanks for the input.
Nick Parker
May your glass be ever full.
May the roof over your head be always strong.
And may you be in heaven half an hour before the devil knows you’re dead. - Irish Blessing
|
|
|
|
|
If you want to use CString but not MFC, I use the excellent CStdString[^] class which is an exact clone of CString but using stl.
Cheers
James
|
|
|
|
|
James Spibey wrote:
which is an exact clone of CString but using stl.
Thanks James, I will take a look at it today.
Nick Parker
May your glass be ever full.
May the roof over your head be always strong.
And may you be in heaven half an hour before the devil knows you’re dead. - Irish Blessing
|
|
|
|