>>can anyone give me their explorer.exe and explorerframle.dll ? (64bit
Can I? Yes. Will I? No.
Reinstall the operating system.
>>can anyone give me their explorer.exe and explorerframle.dll ? (64bit
Can I? Yes. Will I? No.
Reinstall the operating system.
On Windows 7 (and probably Windows Vista too) you will not have permissions to query that database in the the folder. I had to move that file to a different folder that I know I have permissions. When I did that the program worked as expected.
Why you are having so much trouble compiling that simple program is beyond me. Does that project have UNICODE turned on? Check the project settings.
Project --> Properties --> Configuration Properties --> General. Then in the right side of the screen, third item from the botom change Character Set to "Not Set"
1) Did you copy/paste the program I gave you into your console application?
I would just shoot the damed thing and hope that he's wrong. If its wrong then skin it, gut it, cook it, and eat it. Yummy :)
You have a lot of syntax errors in your program. Here's the correctins. I added another parameter to that function -- the size of returnbuf. I didn't test it out because I don't have a copy of that database.
#include <iostream>
#include "cppSQLite3.h"
#include <string>
#include <string.h>
using std::string;
using std::cout;
using std::cin;
char* GetDirectory(const char* Subdomain,const char* PCD,char * returnbuf,int bufsize);
int main()
{
char InstallPath[255] = {0};
char Subdomain[] = "{A334FDED-DCCA-481E-B226-F902CCC419D2}";
char Path[] = "C:\\Program Files (x86)\\Common Files\\Adobe\\Adobe PCD\\pcd.db";
char* p = GetDirectory(Subdomain, Path, InstallPath, sizeof(InstallPath));
if( p != NULL)
cout << InstallPath << '\n';
else
cout << "GetDirectory() failed\n";
}
char* GetDirectory(const char* Subdomain,const char* PCD,char * returnbuf,int bufsize)
{
//Write a function to get the installation directory.
try
{
CppSQLite3DB db;
std::string command;
command = "select value From domain_data where SubDomain = '";
command += Subdomain;
command += "' And key = 'AMTConfigPath';";
db.open(PCD);
CppSQLite3Query q = db.execQuery(command.c_str());
db.close();
const char* p = q.fieldValue(0); //Without the one in bold, error message: error: invalid conversion from 'const char*' to 'char*' is thrown.
if( p != NULL)
strcpy_s(returnbuf,bufsize,p);
return returnbuf;
}
catch (CppSQLite3Exception& e)
{
return NULL;
}
}
What version of MS-Windows? The program has to have permissions to start services.
void City::setNextCity(City city) {
nextCities->push_back(&city);
};
You can't do it like that because the parameter is a copy of City class, and will be destroyed as soon as setNextCity() exits. You need to make list own all the memory so that it doesn't rely on anything outside of it.
Just off the top of my head this is how you will have to do it. Note that you will also have to add a copy constructor to City class.
void City::setNextCity(const City& cty) {
nextCities->push_back(new City(cty) );
};
Programmers use code guards, sometimes called include guards, to avoid the problems with double inclusions. You will find them used in almost (if not all) the standard header files that are installed with your compiler. When used, they would prevent the problem like the example presented by evstevemd, above.
You are wasting your time and efforts trying to optimize that. There are only a few clock ticks difference between the two, and any optimizing you do with that will not even be noticable.
Concentrate first at the function level -- do some profiling to see where the bottle necks are.
The man is dillusional -- he's looking at a reflection of himself in a pond and thinks he sees a rabbit out of Allice in Wonderland.
What does he do? He shoots at the rabbit, but the bullet reflects off the water and hits him in the forehead, killing him instantly.
>>doesn't the << operator on stringstream parse the input using white-spaces as the delimeter
No, but the >> operator does.
change out >> dateString
to getline(out,dateString);
There is probably something else wrong with your program. Try this:
#include <iostream>
#include <sstream>
#include <string>
using std::cout;
using std::cin;
using std::string;
using std::stringstream;
int main()
{
//Opens a stringstream and allows integers to be displayed as a string
string name = "Peter";
int weight = 100;
int height = 6;
string location = "Anywhere USA";
string dateInception = "2010/10/15";
string tendency = "Happy";
string dateDeath = "Still Alive";
stringstream out;
string dateString;
//stores integers and strings into a string out stream
out << "Name:" << name << "Temperament:" << tendency <<
"Weight:" << weight << "Height:" << height <<
"Location:" << location << "DOB:" << dateInception <<
"Death:" << dateDeath;
//displays the string using the command out instead of cout
out >> dateString;
cout << dateString;
}
>>#include<iostream.h>
>>void main()
Get another teacher because that one doesn't know what he/she's doing. Better yet, go to a different school because that one is probably trying to teach you how to program in the 21st century with a compiler that was written in the 2nd century (e.g. Turbo C++)
But besides that, did you bother to compile and run that program yourself so that you can see what it does? If not then you should do so.
If the value of name is "Peter" then the result should be "Peteris the person's name". Note that there is no space between Peter and "is" because you didn't put one there. If you want a space there then use << " is ..." (space before is).
No. Windows win32 api functions require a 32-bit compiler. Turbo C is a 16-bit compiler. Come into the 21st century and get either free Code::Blocks or vc+ 2010 Express.
You mean like this?
#include <conio.h>
#include <iostream>
using std::cout;
using std::cin;
int main()
{
char c;
while(true)
{
cout << "Enter a character\n";
c = getche();
if( islower(c) )
cout << "\nLower\n";
else
cout << "\nNot lower\n";
}
}
Well you had better use a different compiler becuse you can't access win32 api mouse functions from that 16-bit compiler. MS-Windows != MS-DOS.
why are you using endl with stringstream? Doesn't make any sense because all endl does is '\n' followed by stream.flush(), which is intended to flush data to hard drive.
So what you are really writing is this: out << name << '\n' << flush << ...
Welcome to DaniWeb.
For readers who are not from USA, AZ is the abbreviation for the state of Arizona, home of one of the World's Greatest Natural Wonders, the Grand Canyon.
c++ program. Just because a function parameter uses cons doesn't mean the calling function has to declare it as const. All const keyword says is that the function is not going to change its value.
In the VB program you posted you need to allocate memory for InstallPath because the C DLL program is going to try to copy a string to that variable. In the code below I just set the size of that variable to 255 characters, because under MS-Windows that's the longest possible path.
#include <iostream>
char* __dllspec(__dllimport) GetDirectory(const char* Subdomain,const char* PCD,char * returnbuf);
int main()
{
char InstallPath[255] = {0};
char Subdomain[] "{A334FDED-DCCA-481E-B226-F902CCC419D2}"
char Path[] = "C:\Program Files (x86)\Common Files\Adobe\Adobe PCD\pcd.db"
char* p = GetDirectory(Subdomain, Path, InstallPath);
if( p != NULL)
cout << InstallPath << '\n';
else
cout << "GetDirectory() failed\n";
}
what operating system and compiler?
Ubuntu is a nice, clean os -- but there isn't much you can do with it. There aren't any games written for it and AFAICT its only useful for using as a web and/or database server. Compare the amount of commercial software available for MS-Windows with the amount available to *nix. MS-Windows blows *nix out of the water.
Installing new programs on *nix is a nightmare. With MS-Windows all you do is download and click the install button. Done. With *nix you have to worry about getting all the packages, and often you have to compile the programs yourself. I understand the reason why you have to compile the programs yourself, but still ...
The only really nice thing I have found about Ubuntu and other *nix distributions is the price -- they are normally free. But, you get what you pay for.
while(true)
{
Read previous post;
}
Red color tags do work. just use the [color=red] ... [/color] color tags. Other colors don't work though.
[color=red]This is in red[/color]
[u]This is underlined[/u]
[color=red][u]This is underlined red[/u][/color]
This is not in red.
If you use [code] ... [/code] the above will work as shown. But if you add the language option, such as [code=c] the above doesn't work because of the line numbers.
And I notice that Dani has put back code tags the way they were, without forcing line numbers. I'm glad to see that change.
Hey, buddy. We have already told you how to do that. Read the previous comments.
What is being passed in as the parameters to that function?
One ways to debug it is to put that function in a simple c++ console program and run it without the DLL. Once you have the function working correctly you can put it into a DLL and call it from the installer.
@junemowar: Are you blind, or just plain stupid ?
>>Im interested in IT, what are my chances of working my way up?
If you live long enough you will outlive everyone else. Eventually you will be CEO :)
Have you never heard of mixed-language programming :)
You are assuming he has MySQL database. AFAIK MySQL++ doesn't work with other SQL databases, such as M$ Access.
You have to add it, probably to CMainFrm class. Add it just as you would any other event handler. Read this thread.
Call DeleteItem() to remove an item from CTreeCtrl. You have to call that function for each item you want removed.
Didn't you bother to read the post I wrote? :@ Why am I wasting my time and effort if you don't want to read it.
I agree -- but I'm just as guilty about not using smart pointers. Here's a link that shows how to use them.
>>//Somehow referenced from the site as most of the source are showing cout and I am not sure whats that. (
No wonder you are having so much trouble, you have not the slightest idea of what you are doing. Anyone with a week's worth of c++ training would know what cout is.
>>returnbuf = q.fieldValue(0);//
Wrong. wrong. wrong.
char* p = q..fieldValue(0);
if( p != NULL)
strcpy(returnbuf,p);
I assumed it was the client that did the receiving. But it doesn't really matter because the techique is the same whether its received by client or server.
Move the ID field to the first field in the packet.
struct {
int32_t msgId; // ID of packet
int32_t msgLen;
char Preamble[11];
char senderId[50]; // email of sender
} helloMsg;
>>How can I check first byte of TCP stream to identify the kind of frames that server receive ?
Normal socket receive stuff
char buffer[256]; // On the stack
nret = recv(theSocket,
buffer,
256, // Complete size of buffer
0);
int32_t x = *(int32_t *)buffer;
switch(x)
{
case 1: /* do soething */ break;
case 2: /* do soething */ break;
case 3: /* do soething */ break;
default: /* errir */ break;
}
Post them in Business Exchange --> Looking To Hire.
>>I'm also a social media geek with a good sense of humor. Can I stay?
No -- we don't allow people with a good sense of humor here. Go away :) (Just kidding)
Have the server check the packet ID field and it will know which packet its getting. Hopefully the ID field is the first item in the packet to make it easier for the programs to reconstruct the appropriate structure.
For example the client would read the first byte from the tcp/ip stream, check whether its 1, 2, 3 or something else. Then read the rest of the data in the stream into the appropriate structure. BTW it might be easier if you made a union out of those three structures so that you only have to pass around only one object instead of three.
look at the header file and you will see whether its public or private. Don't be afraid to browse around the header files in the project and become familiar with what they contain.
>> plz let me know how can I change it??
You don't want to change it. Instead, write a public method that allows other classes access to the ListBox. For example, if ClassA wants to add a string to the list box, then in MyProgDlg.cpp you would write a public method that accepts a string as parameter and then it adds the string to the list box. This is exactly the same technique used in all c++ programs called getters and setters
weight_ is an integer, but the parameter in the constructor has it as a double. Which is it???
The sortingFunction() function should use < operator, not <=.
[edit]Oops! already answered.
He's using an SQL database -- what you suggested will not work.
>>Also, if you're passionate about what you're doing, 14 - 16 hours does not seem like a great deal of time
I don't care how pasionate you are, those kinds of working hours will eventually take the toll on you, your family, and your health. You will have a very short marrige if you spend all your time sitting in front of a computer.
>> would recommend that if you truly want to be good at what you do, you never stop studying and learning
That is very very true. IT industry is constantly changing and you need to change with it or you will become obsolete very quickly. This is not one of those fields where you can say "I know all there is to know about it".
The problem with that loop is that it might stop the program from processing other windows messages, unless there is anther message pump like the one in main() within that loop.
Here is one of many tutorials you will find. I wouldn't exactly call ODBC "dead easy", but you only need a good grasp of C or C++ language.
In order to do anything useful you will need to learn SQL (Structured Query Language). Again, there is lots of information on the net. This wiki article is a quick overview.
>>The problem is when I go to close my program either by the X at the top right, or using the right button of my mouse which has code to destroy the application. It hangs, and does not terminate the program
Most likely because it is processing all those WM_LBUTTONDOWN event messages. Use the compiler's debugger and find out if that is the cause or not.
Try setting a flag in the WM_CLOSE message to disable the WM_LBUTTONDOWN events.