|
It seems your dll needs to a lib file.
|
|
|
|
|
Yes. You need to link your Dll project with the .lib files from the Dlls your project calls into. If you don't have .lib files for the dlls you need to use then you'll have to load them at runtime using the LoadLibrary API function and use GetProcAddress to get function pointers to the entry points for the functions you want to call. If all this seesm a bit arcane then at least you now know why COM got invented.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
If you do not want to use "loadlibrary" see other reply)
1) You cannot set a path for a DLL, you must either have your new DLL in the same directory as the DLL you are calling, or put it in the windows/system32 directory.
2) You need to link the lib file. Either add the lib file using project properties or add following to your source file
#pragma comment(lib,"DllName.lib")
3) Add the header file for the DLL to your source file.
|
|
|
|
|
I am by no means an experienced c++ programmer, but am trying to store multiple occurances of 3 strings in a vector of vectors and need to reference the stored values from a nested for loop. I can't seem to stumble or fumble onto the correct syntax. Below is a short example that I am using as a test case.
<br />
#include <iostream><br />
#include <string><br />
#include <vector><br />
<br />
using namespace std;<br />
<br />
struct s {<br />
string strA;<br />
string strB;<br />
string strC;<br />
};<br />
<br />
void main (int argc, char *argv[]) {<br />
<br />
typedef vector <s> vstype;<br />
vstype v;<br />
<br />
s bugs;<br />
bugs.strA="bees";<br />
bugs.strB="beetles";<br />
bugs.strC="flys";<br />
<br />
v.push_back(bugs);<br />
<br />
s bugs2;<br />
bugs2.strA="chiggers";<br />
bugs2.strB="moths";<br />
bugs2.strC="praying mantii";<br />
<br />
v.push_back(bugs2);<br />
<br />
bugs.strA="mosquitos";<br />
bugs.strB="ants";<br />
bugs.strC="ticks";<br />
<br />
v.push_back(bugs);<br />
<br />
cout << bugs.strA << endl << endl;<br />
<br />
string dummy = bugs.strA;<br />
<br />
<br />
for( vstype::const_iterator p=v.begin(); p!=v.end(); ++p) {<br />
cout << "3 BUGS" << endl << (*p).strA << endl << (*p).strB << endl << (*p).strC << endl << endl;<br />
}<br />
<br />
v.clear();<br />
<br />
for( p=v.begin(); p!=v.end(); ++p) {<br />
cout << "3 BUGS" << endl << (*p).strA << endl << (*p).strB << endl << (*p).strC << endl << endl;<br />
}<br />
<br />
cout << "===============" << endl << endl;<br />
<br />
vector <vstype> vx;<br />
<br />
vx.push_back(v);<br />
<br />
v[0].strA="aphids";<br />
v[0].strB="stink bugs";<br />
v[0].strC="dragonflys";<br />
<br />
vx.push_back(v);<br />
<br />
for (vector<vstype>::const_iterator s=vx.begin(); s!=vx.end(); s++) {<br />
for (p=(*s).begin(); p!=(*s).end(); p++) {<br />
cout << (*s)[0] << endl;<br />
}<br />
cout << endl;<br />
}<br />
<br />
}<br />
I realize that I might be able to dereference with some sort of vs[x][y] notation, but was trying to get it to work this way just for grins.
Any suggestions would be greatly appreciated. Thanks.
|
|
|
|
|
for instance:
for (vector <vstype>::const_iterator s=vx.begin(); s!=vx.end(); s++)
{
for (p=s->begin(); p !=s->end(); p++)
{
cout << p->strA << endl << p->strB << endl<< p->strC << endl;
}
cout << endl;
}
Please remove the v.clear(); statement in your code (unless you like the debugger complaining...).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Hi Experts,
I want to change the content of a file.I am using the WriteFile() function to overwrite the file, but this is very slow.So please, could you tell me another alternate ?
Thanks in advance.
|
|
|
|
|
how do you mesure this ?
how are you sure it is the WriteFile() that is slow ?
modified on Tuesday, December 04, 2007 7:19:03 AM
|
|
|
|
|
It will most probably be the way of usement he makes.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
How big are the files you want to write?
Can you post a piece of your code?
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
The instruction at "0x73dd11c7" referenced memory at "0x00000004". The memory could not be "read". Click OK to terminate the program
This is the error i am getting in the RELEASE VERSION alone. In Debug version the application is running fine.
Can you suggest any measures to avoid this??
Thankyou.
Priya Sundar
|
|
|
|
|
This is memory related problem.There might be some memory leakage.Analyse the code again.
|
|
|
|
|
Did you use of pointers on your program?
|
|
|
|
|
I can give you two hints.
1) Debug in Release version itself. For that do the following project settings.
In C/C++ tab,
- Optimizations : Disable Debug.
- Debug Info : Program Database
In Link tab,
- enable "Generate Debug Info."
2) For tracking the memory leaks, the following link will help you.
http://msdn2.microsoft.com/en-us/library/e5ewb1h3(VS.80).aspx[^]
Regards,
Jijo.
________________________________
Yesterday is history,
Tomorrow is a mystery,
But today is a present.
|
|
|
|
|
Priya_Sundar wrote: In Debug version the application is running fine.
I suspect not. While errors may move around in memory, they seldom, if ever, go away on their own. The Debug version is likely just masking the problem, thus making it appear to work.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi friends
In a my program a scroll window is provided. Drawing a line while moving cursor in scroll window. After scrolling it doesn't show correct position.
thanks in advance
-RisKhan-
|
|
|
|
|
It can be more than a problem, but i guess it has to do with your MAPMODE and ScrollPosition in every moment.
Lets say... you make a line with a click in X=5, Y=5 to X=50, Y = 50. If you scroll the window but you are not taking in consideration the scroll position, the line will just stay in the same relative place without scrolling, but the real coordinates will be i.e. (5,25) and (50, 70) because the top-left corner of your view has another value after scrolling. This is because you are not using the GetScrollPosition to translate the coordinates of the points when you do the mouseclick or the OnDraw.
Other possibility is you make the line down in the window and when you try to scroll down the view... the line should go up, but it really goes down disappearing from the scope. This is because you are not matching the MAPMODE with the addition/substraction of the Scroll Position when drwaing the View.
And the third possibility, you make the start clik in (5,5), then you go to the scrollbar and take the window down, after scrolling you release the click in the window, but the line doesn't appear as it should. The problem here s just a mix of both upper cases.
Post some relevant code, as where you use SetScrollSize (to see MAPMODE), the OnMouseClick (to take the coordinates of the line) and your some lines of your OnDraw (where you try to make the line)
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
Hi all,
I have create database connection in my application and use it in several locations. That mean I'm using more that one tables with same connection. What I have done is execute separate queries with same connection.
But now I have a question. One of my table have large number of columns. So i write separate query as follows, actually a database function.
<br />
public bool DataToDB(int GroupID, int SessionID, int PartID, int DestinationList, int MemberID, int DataMessage, int ServiceID, int ActivityID, int Bio_Size, image Bio_Data)<br />
{<br />
<br />
string sqlCommand =<br />
"INSERT INTO RecordData (GroupId, SessionID, PartID, DestinationList, MemberID, DataMessage, ServiceID, ActivityID, Bio_Size, Bio_Data) <br />
VALUES (@GroupId, @SessionID, @PartID, @DestinationList, @MemberID, @DataMessage, @ServiceID, @ActivityID, @Bio_Size, @Bio_Data)";<br />
Database db = DatabaseFactory.CreateDatabase();<br />
db.AddInParameter(dbCommand, "GroupId", DbType.Int32, GroupId);<br />
db.AddInParameter(dbCommand, "SessionID", DbType.Int32, SessionID);<br />
db.AddInParameter(dbCommand, "PartID", DbType.Int32, PartID);<br />
db.AddInParameter(dbCommand, "DestinationList", DbType.Int32, DestinationList);<br />
db.AddInParameter(dbCommand, "MemberID", DbType.Int32, MemberID);<br />
db.AddInParameter(dbCommand, "DataMessage", DbType.Int32, DataMessage);<br />
db.AddInParameter(dbCommand, "ServiceID", DbType.Int32, ServiceID);<br />
db.AddInParameter(dbCommand, "ActivityID", DbType.Int32, ActivityID);<br />
db.AddInParameter(dbCommand, "Bio_Size", DbType.Int32, Bio_Size);<br />
db.AddInParameter(dbCommand, "Bio_Data", DbType.image, Bio_Data);<br />
db.ExecuteNonQuery(dbCommand);<br />
<br />
}<br />
If you want I'll put my code/function related to this function on another post. My question is that how to use this on my C++ application. Any easy way to do it.
|
|
|
|
|
Your question is an easy way to do query, isn't it?
If yes, I think you can use, a class of ADO database set. There is a few class that provide it, in codeproject. By using this class you can used "Con.execute" like in VB.
|
|
|
|
|
How about the use of Post Procedure, I can define the command object and execute the post proc in C++.
I appreciate your help all the time...
Eranga
|
|
|
|
|
If what do u mean is store proc, the answer :
Sure, u will be able to execute any query.
|
|
|
|
|
I want to access fat table( where my partition information is store) how can i access it through codding.
|
|
|
|
|
This is my there msg that i am posting.
Please give me a hint how to access my fat table
Any link will be appreciated.
Thanks
|
|
|
|
|
It's only been two hours on a site that just underwent a major upgrade. Be patient!! Someone will help if and when they want to.
|
|
|
|
|
JudyL_FL wrote: Someone will help if and when they want to.
What kind of service is that? For the price we are paying, someone should be on call 24/7. Questions must be answered in a timely manner.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Yessss maassstteer <best igor accent>
modified on Tuesday, December 04, 2007 4:15:28 PM
|
|
|
|
|