|
hi everyone
I recently visited the site codeproject & went through the tutorial
on install shield. I have recently made an installation which installs
my application in VC++ & at the same time installs the InterBase Server
& console. To achieve this installation i make entries in registry & for
auto starting the interbase server i have made entry in
HKEY_LOCAL_MACHINE\Software\Microsoft\CurrentVersion\Run
as InterBaseGuardian REG_STR <root dir="">IBServer.exe -a.
The installation is done in install shield for Microsoft VC++6.
I m facing a whimiscal problem whenever i install my appliaction in a compaq
machine that already contains Interbase server as well as VC++6 installed
in it. I tested my installation in an assembled machine which already has
both the things installed, but there it doesn't show that error.
As soon as the appliation is run it first shows message box "cann't create
socket" and then it shows "XTG unable to establish connection to the host
unknown win 32 error 10106".
Is this error due to the istallation script or its related with the
application or interbase server.
Please help me out i ll be really grateful.
thanking you!
regards
a struggling software engineer
ashutosh pandey
|
|
|
|
|
Does any one know how if it is possible, and how to derive from a templatized class that specializes with a specific text string. Here is an example:
template<char* str>
class X
{
void print()
{
cout << "Your initialized Template string is: " << str << endl;
}
};
class Y : public X<"display">
{
...
};
//then instantiate and use the class like so:
Y yDisplay<"display">;
yDisplay.print();
// and here is the output
Your initialized Template string is: display
I can perform this feat with a DWORD. And I can instantiate an X type object that specializes on a text string.
//This seems to work fine.
X xObject<"hello">;
But I cannot figure out if it is possible to derive from a class that has specialized on a particular text string as a template parameter.
Thanks in advance.
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 the link, it has a lot of good information. However my problem is a little more difficult than that. I actually stumbled on the solution to get the string literal to work, however I still have the problem of deriving a class from a templatized class that contains a specific string literal.
Example:
Does any one know how if it is possible, and how to derive from a templatized class that specializes with a specific text string. Here is an example:
template<char* str>
class X
{
};
//Notice how this class is derived from a specialized version of X with a specific string literal.
char DISPLAY_STR[] = "display";
class Y : public X<DISPLAY_STR>
{
...
};
THis is the error that I receive as well.
'X' : template argument 'str' : invalid address of local variable 'str'
Thanks again
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!
|
|
|
|
|
kilowatt wrote:
//Notice how this class is derived from a specialized version of X with a specific string literal.
char DISPLAY_STR[] = "display";
class Y : public X<DISPLAY_STR>
This is no string literal. "foo" is a string literal. You're trying to use a variable and that will (of course) fail miserably.
If your intention is to "hide" the real string used as a literal behind another name, your only option is to use a macro:
#define DISPLAY_STR "display"
|
|
|
|
|
Well, you have a point with my misuse of vocabulary on the problem.
However if I want to instnatiate class X with a string parameter, the method that you have suggested will not work. If you read the link that Mike Dunn posted above, you need to create a variable with external linkage in order for the template to be able to use it. Here is a summary.
#define FOO_DEFINE "foo"
X xObject1<"foo">; //will not work
X xObject2<foo_define> //will not work either, same as xObject<"foo">
char FOO_STR[] = "foo";
X xObject3<foo_str>; //THe correct way to do it.
Anyway my real problem is that I want to derive a class Y from a specialized version of X, like so:
class Y : public X<foo_str>
{
};
class Y is not a parameterized class, however it will use a special version of X.
Thanks again.
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!
|
|
|
|
|
The error message is descriptive enough. What is the linkage of DISPLAY_STR ? It has to be external for the template to work. The problem has nothing to do with deriving from X<DISPLAY_STR> : you should meet it also by simply instantiating a X<DISPLAY_STR> .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I typed up a simple version like the example that I showed you guys and got it to work, then I found tha tI had declared <const char*> instead of <char*> as the template parameter and now it works.
Thanks
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!
|
|
|
|
|
I now know that it is possible and here is how it can be done:
#include "stdafx.h"
#include <iostream>
using std::cout;
char szHello[] = "Hello ";
char szWorld[] = "World!";
template<char* str>
class X
{
public:
void print()
{
cout << str;
}
};
class Y : public X<szWorld>
{
public:
int i;
Y();
};
Y::Y () : X<szWorld>()
{
};
int main(int argc, char* argv[])
{
X<szHello> xObject;
xObject.print();
Y yObject;
yObject.print();
return 0;
} Thanks for all of your help.
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!
|
|
|
|
|
I want to use the checkbox like this:
if(checkbox was clicked)
{}
else{}
how could I do ?
|
|
|
|
|
if (IsDlgButtonChecked (IDC_CHECKBOX)) {
} else {
} /ravi
Help put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Try this:
CButton * pButton = (CButton*)GetDlgItem(IDC_CHECK1);
if (pButton->GetCheck())
{
}
else
{
}
Best regards,
Eugene Pustovoyt
|
|
|
|
|
Can anyone tell me how can I export template class from a DLL.
I have created a wrapper to wrap some STL containers (as STL can't export through DLL boundary), and wanna export the wrapper as accessor.
Say, I declared in "ListType.h"
<br />
#ifdef DLL_EXP<br />
#define MY_EXP __declspec(dllexport)<br />
#else<br />
#define MY_EXP __declspec(dllimport)<br />
#define<br />
<br />
template class MY_EXP CMapList<T><br />
{<br />
void insert(long key, T* pd)<br />
{<br />
....<br />
}<br />
bool next() { .... }<br />
T* get() { .... }<br />
<br />
....<br />
};<br />
<br />
class CMyClass1;<br />
class CMyClass2;<br />
<br />
CMapList<CMyClass1>;<br />
CMapList<CMyClass2>;<br />
I tried to use the wrapper class in the App project, but I experienced Access Violation with subsequence next() and get() calls.
How can I make sure the DLL project is exporting the class CMapList<cmyclass1> and CMapList<cmyclass2> ?
How can I avoid that the App project will use the declaration in the DLL, not generated CMapList<cmyclass1>, CMapList<cmyclass2> from the header file directly ?
Thanks for help ^^
|
|
|
|
|
Sorry, the code section before should be :
<br />
#ifdef DLL_EXP<br />
#define MY_EXP __declspec(dllexport)<br />
#else<br />
#define MY_EXP __declspec(dllimport)<br />
#define<br />
<br />
template class MY_EXP CMapList<T><br />
{<br />
void insert(long key, T* pd)<br />
{<br />
....<br />
}<br />
bool next() { .... }<br />
T* get() { .... }<br />
<br />
....<br />
};<br />
<br />
class CMyClass1;<br />
class CMyClass2;<br />
<br />
CMapList<CMyClass1><br />
CMapList<CMyClass2><br />
|
|
|
|
|
Can anyone tell me how can I export template class from a DLL.
Yes. Use Comeau C/C++ compiler. That is currently the only publicly available compiler that can make use of the export keyword.
The best you can do with MSVC is to export a specialization or provide a non-data-type-dependent implementation of something in/from the DLL and then create your class templates as thin wrappers around what the DLL exports.
|
|
|
|
|
But I have to tie to MSVC++ 6.0. I'm doing a wrapper to wrap the dependence of STL within the DLL. However, I don't know how to put the class template CMapList<cmyclass1> specification into the DLL. If I just put the template CMapList<cmyclass1> into the header file. Will it generate code to put into the DLL ? ( I don't think so )
|
|
|
|
|
However, I don't know how to put the class template CMapList specification into the DLL.
IIRC it looks something like
__declspec(dllexport) template<> class CMapList<your_type(s)>
That is intended to both create an explicit instantiation of the class template and export the instantiated template class.
But, isn't this in the compiler documentation? Like since Q168958 for VC5.
|
|
|
|
|
PC: CII733+20G+128M SDRAM..(because i'm a poor student,
I use win98. But when i setup win XP Professional, I found WIN XP's speed is so.... I want to know , as a programer fan, which OS you like it much? Point me!!!
|
|
|
|
|
I prefer to develop on 2000, but I expect I'll need to convert my aging spare PII-300 128M machine from 98 to XP in order to test my software.
/ravi
Help put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I am very happy with windows 2000, however I have not yet tried Windows XP.
I have an AMD K6 350 MHz running Windows 2000 and it is doing great.
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!
|
|
|
|
|
my god! that seems i need more memory for running win XP.
|
|
|
|
|
Any of the NT based operating systems, Win2000 being the best for development at the moment. I haven't developed on a 9x machine for years, they just crash too often and I could never tell if it was my bug or 9x being flaky.
I'm surprised at the amount of developers who still use 9x, even in large companies who can afford the Win2000 licences.
Michael
Errata 1: p. 154, section 'Defusing'. For 'red wire' read 'blue wire'.
|
|
|
|
|
LOL, I like your sig Michael.
Mark A
|
|
|
|
|
I'm surprised at the amount of developers who still use 9x, even in large companies who can afford the Win2000 licences.
Just because they can make Bill Gate$ richer doesn't mean that they want to.
|
|
|
|
|
Hi all,
I have a second user that logs into my computer that would like to have the same settings profile that I currently have on my machine. I am talking about the default IDE settings like the file directories, colors, macros and such, have all been reset with a new user account. I want to know if anybody knows how to transfer these settings from one user to another.
Thank you
kilowatt
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!
|
|
|
|