|
IHMO if a DLL or EXE is in memory it IS loaded
Secondly...how do you know it's in memory and how did you get it there?
Did you open the exe and copy the entire file into RAM???
Use LoadLibrary()
If after this you still feel the need to load a DLL manually you would probably have to read some of the advanced hooking articles on here...I recall and article that disscussed ways of changing your CPU's IP allowing you to hijack API calls and such, which is probably the direction you want to head in
Cheers
How do I print my voice mail?
|
|
|
|
|
HINSTANCE hinst_yourdll;
BOOL m_bCanDo;
hinst_yourdll = LoadLibrary( "yourneed.dll" );
m_bCanDo= FALSE;
if(hinst_yourdll)
{m_bCanDo = TRUE;
dllfunc_yourneed = ((LPFNDLLFUNC1) GetProcAddress( hinst_yourdll, "yourneedfunc" ));
}}
|
|
|
|
|
Hi !!
Please help me, i have the following problem with "read data from txt"
First of all I have #include <fstream> and there is also : using namespace std;
typedef int Pont[3]; // 3D (x,y,z) co-ordinates
<code>int Pointloader()
{ const int PontNum= 5;
int load[3]= {0};
Pont RendPoints[PontNum];
ifstream my_file("d:\\prog2004\\my_file.txt");
my_file >> (int)load[0] >> (int)load[1]>> ' ' >> (int)load[2] >> ' ' >> '\n';
my_file.close();
}</code>
DEBUG:
error C2679: binary '>>' : no operator defined which takes a right-hand operand of type 'const char' (or there is no acceptable conversion)
Muad-Dib
mailto:adamo_piar@freemail.hu
Made in Hungary
|
|
|
|
|
Remove ' ' from this line:
my_file >> (int)load[0] >> (int)load[1]>> ' ' >> (int)load[2] >> ' ' >> '\n';
and change it to:
my_file >> (int)load[0] >> (int)load[1]>> (int)load[2];
Kamyar Souri
Booria CAD/CAM Systems
www.booria.com
|
|
|
|
|
#include<fstream>
#include<iostream>
using namespace std;
void Pointloader()
{ //const int PontNum= 5; //i dont know its use
int data;
int load[3]= {0};
//Pont RendPoints[PontNum];
ifstream my_file("F:\\test\\mytest.txt");
int i=0;
while ( my_file >> data )
{i+=1;
cout<
|
|
|
|
|
Hello,
<br />
while ( my_file >> data )<br />
{i+=1;<br />
cout<<data;<br />
load[i]=data;<br />
} <br />
this won't work when there are more lines of data!
Exemple:
The text file contains two lines of data:
1 23 345
456 5 567
The first two numbers will be read correctly. After you read the third number, i will contain the value 3, which will result in undefined behaviour!!!
if the program is very small, you can be lucky, but this is very and I mean VERY bad programming!!!
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
guys:
there are the folowing data(greater than three lines:
123 23 45
23 56 89
123 345
6564
65757
123 456
the running result:
123 23 45 23 56 89 123 345 6564 65757 123 456 Press any key to continue
|
|
|
|
|
and therefore the running result for the index integer i would become greater than two! since your array isn't dynamic, you'll end up writing to adresses that arn't allocated or even worse, adresses allocated to other variables...
That kind of programming mistakes lead to undefined behaviour...
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
Hi All,
What do I need in oreder to store Information from some computers, and later check/use this information in a different files?
mmfried
|
|
|
|
|
Why is the title "Registry"?
Don't try it, just do it!
|
|
|
|
|
If I wasn't clear enough I want to read the registry of other computer (remotl connected) to some computer, collect the reg. info. from that computer, (and then use the info. later).
- I don't want just to copy files, but registry info. from a remote computer.
|
|
|
|
|
|
Hi.
I was wondering of anyone can shed light on how labview (and the like) send the SAME data (maybe a packet from socket or from a hardware card or something) to multiple objects like graphs that wants it? What would be the best way to connect all these together so that memory is best controlled? Or is it that the object who wants certain data looks at a certain memory location. Maybe each object will process data at different rates.
I hope I am explaining it right. Right now, I have threads that read from Sockets with information that needs to be sent to multiple objects. Maybe multiple object will want the same information. The data for the sockets will be coming in fast continuously. It just seems that alloc memory and sending this packet to everyone is not very good. I am also thinking that I will put this in a memory location and then send a message to the object telling it that data is ready. But then how do I let multiple object read the same location and then update it when the last object reads it. Each object may read it at different times.
Thank you for any thoughts.
|
|
|
|
|
It sounds like a classical use for 'publish and subscribe' 'pattern'/method .. you have one publisher broadcasting the data to multiple recievers ie subscribers - I havnt thought about this a lot, because it depends on the size of the incoming 'data packet' - if its quite large, you could use the same pattern, but a pointer to the data in a shared memory region could be published, then each subscriber can read the data from the shared memory with the pointer ...
there are quite a few implemenations of pub/subscribe around, 'Plugware Solutions' I beleive published an article here on CP recently ...
hth
'G'
|
|
|
|
|
All you should do is to synchronize multiple threads to treat your data in a safe manner.
because your data is shared resource between these threads so you must protect it with a Semaphore (an OS synchronization object).
See MSDN->SDK for more details...
Kamyar Souri
Booria CAD/CAM Systems
www.booria.com
|
|
|
|
|
How can I change the relational operator according to user selection?
example:
(can this be simplified?)
<br />
if (nUserCode==1){<br />
if (num1 > num2 &&<br />
num2 > num3 &&<br />
num3 > num4 &&<br />
num4 > num5) DoSomething();<br />
} else<br />
if (nUserCode==2){<br />
if (num1 < num2 &&<br />
num2 < num3 &&<br />
num3 < num4 &&<br />
num4 < num5) DoSomethingElse();<br />
}<br />
|
|
|
|
|
no, i can't see a simplest way to say that the numbers are in order...
or you write a generic function, but that is not the simple way you were looking for.
<font style="color:blue;">if </font>(nUserCode == 1) {
<font style="color:blue;">if </font>((num1 > num2) && (num2 > num3) && (num3 > num4) && (num4 > num5)) {
DoSomething(); <font style="color:green;">
}
<font style="color:blue;">else if </font>(nUserCode == 2) {
<font style="color:blue;">if </font>((num1 < num2) && (num2 < num3) && (num3 < num4) && (num4 < num5)) {
DoSomethingElse(); <font style="color:green;">
}
}
}
TOXCCT >>> GEII power
|
|
|
|
|
What I meant was:
if (nUserCode==1)... use the ">" operator else
if (nUserCode==2)... use the "<" operator
is there any way to substitute the relational operator with a variable?
e.g.
(num1 Variable num2)
when nUserCode==1, the above becomes (num1 > num2). Similarly,
when nUserCode==2, the above becomes (num1 < num2).
|
|
|
|
|
you can do that with macros, but that's not very beautiful.
TOXCCT >>> GEII power
|
|
|
|
|
A funny way!!!
for User 2 just swap the pairs->(num1 with num2),...
Kamyar Souri
Booria CAD/CAM Systems
www.booria.com
|
|
|
|
|
Hi all,
this is not a C++ question, but i think i can get answer here.
i want to register a domain and need around 200M space for a small business.
my Q is: which company offers the service with good price and support?
i have used google to find few companies, but none of them answered any my enquiries.
if you use or know this sort of companies, please give me a link.
thanks
includeh10
|
|
|
|
|
First off:
Register your domain with GoDaddy...
Second what kind of enquiries did you need answers too? I find I contribute more to my hosting providers message forums then they're tech support combined However thats not to say they aren't a decent company...i've never needed their help really, but they offer a public forum none the less...and fairly quick (couple hours usually) email repsonse for immediate answers...and I imagine they have a phone # but probably takes forever to get a hold of someone
They offer decent hosting space/php/mysql which justifies all my online business needs (for the time being). Bandwidth is through the roof(25 GB or something) and my web site can handle some decent traffic (for all my purposes so far) I would assume 5-15 visitors at a time...a few seconds apart anyways...it's a shared host so I don't get that much free time
Truth be told, in my experience all hosting companies are the same....they really suck...and few offer above and beyond what they have too...they're not run my computer geeks who love technology...they're run by business men who noticed a niche market that needed filling...and now of course there are too many...which casues serious competition...which is actually a bad thing...
I have known people who rent the space of a dedicated host off a major provider and turn around and sell that service back to the public for dirt cheap and never make it anywhere because they charged to little to stay "competitive"
What happens when your hosting provider goes out of business??? Depends on who your hosting company hosted with...if they're a large provider and offer daily backups and the whole nine yards...they're probably keep a recent back up of all your data for about a week (in my experiences anyways) but many hosting companies pull the plug on your files database, etc when te funds run out and then it's "sa la vie"!!!
So this is what typically look for...
A hosting company which offers all basics that your business will need...
FTP
Sufficient bandwidth
disk space
MySQL/PHP (latest stable versions)
Flexible backend control panel (myPhpAdmin is ok, but not the best)
If they are willing to dish out chunk of change and purchase a quality CPanel you can probably bet they're in business for the long haul...and not some quick startup bound for failure.
1) If you don't get a response with a couplt hours...they aren't worth it (espcially by email)
2) Visit their web site a few times through out the day...if it's slow to load (a couple times)...thats not saying much for a hosting company
3) If they offer web design services (I shouldn't be advertising to competition, but...) and graphics etc...their probably a smaller firm, but are highly dedicated to what they do...so look for these guys...only...don't sign up for more then 3 motnhs incase they suck...after you've been with them for a year or so and your happy then save the 80 bux aa year or whatever a signup for a 12 month term
p.s-This should have probably been posted in the lounge or web dev forum
Cheers
How do I print my voice mail?
|
|
|
|
|
Hi Hockey,
thank for your long suggestion
cheers
includeh10
|
|
|
|
|
how can i erase the quotation marks in a CString?
ie.
strTmp.Replace(""", ""); does not work
how can i get around this?
|
|
|
|
|