|
I've decided that the modular design of a DLL would be beneficial in a project I'm doing. I've read and followed the howto's and made the barebones DLL file and I've also read how to export data using __declspec (dllimport)/(dllexport). Like in the past, these howto's don't enhance my overall understanding, thus I am asking you, the reader. I've also read many different howto's to try and answer my own questions but each one seems to do things different from the rest so I don't have a clear picture of DLL's.
I'd like to create a DLL that takes in some parameters like a username or password and a couple other things, possibly download information from the internet, process the information, then be available for queries on that information once processed.
First, I don't see how I can "start the music" so to speak by initializing a class inside the DLL with data given to it.
Second, can I run the processing using a thread inside the DLL? The information to process takes 30 seconds on average and I don't want to hang the main app while it works.
If you can provide code examples even just as pseudocode, that would be much more informative than trying to explain it to me because I work best off of example.
|
|
|
|
|
Help me. I write a UDP/IP transfer file programe,but don't transfer,Who can help ? Please leave Email , i'll talk about with UDP/IP transfer file.
i use MFC c++
........
|
|
|
|
|
Post the part of the code where u r getting error
|
|
|
|
|
|
Is there any easy way to flip the positive direction of an axis, say the x axis?
I tried to negate the main glScaled() call that sets up where the camera looks at the scene from. This appears to reverse the direction like I want, but all of a sudden all objects are grey. Is this a lighting problem? Or something more serious like the clockwise / counterclockwise plotting of triangles or some such problems...?
Much thanks!
swine
[b]yte your digital photos with [ae]phid [p]hotokeeper - www.aephid.com.
|
|
|
|
|
After recieving a lot of help on some other topics I have posted on I thought I would try my latest quandry....
As I have posted before I am trying to move files from C:\alreadyCreatedDirectory to C:\directoryIcreate in a C++ program. I have built a .NET version and a version using the system() call, but i am looking to add some complexity to it using recursive driectory copying (copy first file copy next file repeat).... I thought I had written code earlier in the day to handle this, but it was a major failure. I am wondering if anyone has done anything similar? And, I was wondering if anyone would mind helping a newbie out with what I consider some pretty technical coding. Thanks
|
|
|
|
|
Hi Bobfilar,
Check
this[^]
Bye
Cool Ju
Vote for Cool Ju
|
|
|
|
|
bobfilar wrote: but i am looking to add some complexity to it using recursive driectory copying (copy first file copy next file repeat).... I thought I had written code earlier in the day to handle this, but it was a major failure.
Like I mentioned earlier, you can use SHCreateDirectoryEx() and SHFileOperation() for this.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
How do I debug a webservice that throws just:
"There was an error generating the XML document. --> Exception of type System.StackOverflowException was thrown."
When I click on the invoke button, (the invoke is a property to a collection)
-Steven
-Steven Hicks
CPACodeProjectAddict
|
|
|
|
|
The way to debug a webservice is to hit F5 if it's part of a web app, or otherwise perhaps attach to process ? Then make a webservice call and have a breakpoint waiting.
What's it written in ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I'm unable to debug it... I hit f5 and it attaches to aspnetw and does nothing... and attempts to load the webservice but never loads it...
It is written in mc++ (which is why I posted my question here)
-Steven Hicks
CPACodeProjectAddict
|
|
|
|
|
(Steven Hicks)n+1 wrote: It is written in mc++ (which is why I posted my question here)
OK, I wondered because it was posted in the C++ forum. I've only done C# web services, I just hit F5 and it all works.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi I'm using c++ msoutlook automation.
I have no problem working with outlook.. except for the dialog that is asking me to choose the accessing time like 1min - 10 mins..
Is there any way to turn off that dialog using c++?
I dont' know whcih function to use to trun off that message prompt.
thanks for your help.
|
|
|
|
|
1
2 classes A and B. B has a private member int x and it should declare a friend function in the header for B to change A, however B's Header sould know A (inlude "a.h")and A's header should know B. but when i do so i get the error include nested level 363
2
I do I make a string member for a class.
(when i declare #include <string> in the header i must use namespace std in order to make it work but then i get the familiar problem of using namespace in header file - I do I set the conflict)
Thanks alot to whoever it be.
Nir.
|
|
|
|
|
talvezu wrote: classes A and B. B has a private member int x and it should declare a friend function in the header for B to change A, however B's Header sould know A (inlude "a.h")and A's header should know B. but when i do so i get the error include nested level 363
You need to make the member protected in order to achieve this, private is not visible to friends.
You can do one of two things. The first is to forward declare the class in the header and have your #include in your cpp ( so you put class A; at the top of the B.h file ). The other is to use a third class as a bridge between the two.
talvezu wrote: I do I make a string member for a class.
The way I do it is to put #include<string> in my stdafx.h. and then put std::string m_string; in my header file, and using std::string in my cpp file. So, I explicitly scope namespaces in my headers, and put using statements in my cpp.
talvezu wrote: i must use namespace std in order to make it work but then i get the familiar problem of using namespace in header file - I do I set the conflict)
If you're worried about conflict, don't use 'using namespace std;', but instead put using statements for the bits of std you want to use.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
First , thank you for your help,
Unfortunatly I still have not succeed in making it right
the problem is that when I declare Class B , I cannot write the folowing
class B;
class A{
...
public :
friend int* B::geta(A* a);
...
}
because it is an implementation.
and I do not have anywhere else to declare friend function beside the header.
regards the 2 answer can you give some more details for me?
Thanks again,
Nir
|
|
|
|
|
talvezu wrote: friend int* B::geta(A* a);
I didn't know you could do that at all. If you can, you certainly can't do it here, the idea is that the compiler knows that class B exists, but certainly has no idea what it contains.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
You don't have to include headers - just use declaration syntax, such as:
<br />
class A;<br />
class B<br />
{<br />
friend class A;<br />
}<br />
---------<br />
class B;<br />
class A<br />
{<br />
friend class B;<br />
}<br />
Igor Green
http://www.grigsoft.com/ - files and folders comparison tools
|
|
|
|
|
Well it is working ,so I guess it is a solution but what if I want to grant just one function,
in porpuse of grant access not to all private members
you can look at the above situation I wrote in reply for cristian.
Thanks.
Nir
|
|
|
|
|
I have a host, asume it is:
name: www.myhost.com
ip: 111.222.333.444 (I got it from cPanel)
when I pass both as server param to MFC class CFtpConnection and get the same contents.
questions:
1) how to get name (www.myhost.com) if I only know ip address and vise verse?
2) If I set a link on html file, such as:
<a href="http://www.myhost.com">link</a>
the page (index.html) can be loaded.
but for link
<a href="http://111.222.333.444 ">link</a>
the page can not be found.
why?
thx
includeh10
-- modified at 17:03 Tuesday 15th November, 2005
|
|
|
|
|
You could use the existent API for that:
gethostbyname and gethostbyaddr
What you are looking for is either resolving a domain name into an IP address or resolving an IP address into domain name
Have a look here (eventhough is a VB page, it uses the same API):
http://www.activeserverpages.su/redir.asp?link=http://www.vbip.com[^]
SkyWalker
-- modified at 17:26 Tuesday 15th November, 2005
|
|
|
|
|
CString csAdd="111.222.333.444"; //assume
int iType=AF_INET;
HOSTENT*ph=gethostbyaddr(csAdd,csAdd.GetLength(),iType);
the function faield with last error 0x2AFC (no message for it).
why?
includeh10
|
|
|
|
|
The first parameter of gethostbyaddr() is the address as a binary number in network byte order, not a CString . Use the inet_addr() [^] function to convert the address.
|
|
|
|
|
thx, it works now.
is there a function to get ip address from domain name?
includeh10
|
|
|
|
|
MSDN example:
hostent* remoteHost;
char* host_name;
unsigned int addr;
printf("Input name of host: ");
host_name = (char*) malloc(sizeof(char*)*16);
fgets(host_name, 16, stdin);
if (isalpha(host_name[0])) {
host_name[strlen(host_name)-1] = '\0';
remoteHost = gethostbyname(host_name);
}
else {
addr = inet_addr(host_name);
remoteHost = gethostbyaddr((char *) &addr, 4, AF_INET);
}
if (WSAGetLastError() != 0) {
if (WSAGetLastError() == 11001)
printf("Host not found...\nExiting.\n");
}
else
printf("error#:%ld\n", WSAGetLastError());
SkyWalker
|
|
|
|