|
void CMyDlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
if (IsWindow(m_ListCtrl.m_hWnd))
{
CRect rect;
GetClientRect(rect);
m_ListCtrl.MoveWindow(rect);
m_ListCtrl.SetBkImage(::LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_BKIMAGE)));
}
}
problem still unresolved, autofit(stretch) no effect! Thanks!
|
|
|
|
|
I am using following piece of code to update excel using dde . I am updating the g_count
as my excel connect it cell get updated with value = 10 ; But I am not able to send string
value i.e. "xyzabcd" etc to the excel cell ,so how can I send string to the excel sheet
using dde
int g_count = 10;
short xltableData[100];
// tdtTable record...
xltableData[0] = 0x0010; // tdtTable
xltableData[1] = 4; // 2 short ints following
xltableData[2] = 1; // # rows
xltableData[3] = 1; // # cols
// tdtInt record...
xltableData[4] = 0x0006;
xltableData[5] = 2;
xltableData[6] = (short)g_count;
DdeCreateDataHandle(g_idInst, (UCHAR*)xltableData, 2*7, 0, g_hszItemName, fmt, 0);
Trioum
|
|
|
|
|
|
I try lot but could not success. can you suggest be some piece of code to pass the binary string .can you replace my code for string
Trioum
|
|
|
|
|
Sorry, my bad. After looked at the prototype of DdeCreateDataHandle[^], it really takes a LPBYTE argument.
Maxwell Chen
|
|
|
|
|
Hi all,
I have one problem in using Multiple Inheritance, please go through below Code
class Base1
{
public:
void Show()
{
cout<<"Base1";
}
};
class Base2
{
public:
void Show()
{
cout<<"Base2";
}
};
class Derived: public Base1,public Base2
{
}
main()
{
Derived d;
d.Show();
}
Error: error C2385: ambiguous access of 'show'
Please provide some solution for the above code. Can virtual Base class concept work in this,if yes then how?
|
|
|
|
|
What's the difference between upcasting and downcasting?
|
|
|
|
|
Symfund wrote: What's the difference between upcasting and downcasting?
I am sorry but,I didn't get how this question answers my question?
|
|
|
|
|
And what are the differences between Bose-Einstein and Dirac-Fermi statistics?
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Syntax Error: WOW! Chinglish! I am not a native English speaker.
|
|
|
|
|
Rahul Vaishnav wrote: d.Show();
The error is because the compiler do not know which Show() function it should call. Show() of Base1 or Base2. Actually which one do you want to call?
You have to tell the compiler which one excatly. like
d.Base1::Show();
or
d.Base2::Show();
|
|
|
|
|
|
Why do you need such multiple inheritance?
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi all
I developed an application using MFc and oracle.
The mFC transactions will be update in to oracle DB.
The app exe works fine in my PC, where as if i run on other pc's, it shows that it requires "Oracle Client".
Is ther any solution to run the exe without installing the oracle client.
|
|
|
|
|
|
This in no way answers his question. And what has his question got with platform neutrality ?
modified on Monday, November 16, 2009 11:07 AM
|
|
|
|
|
Hi...
i have a text file. Its size is more than 400000 bytes.
i need to store the file into single CString or char variable... Because i have to compare some variable, delete.
How can i store?
Thanks...
G.Paulraj
|
|
|
|
|
You to use CStringArray class, Just refer [^].
Since it is a array, you can store each line as a single array content.
You can do string manipulation in it easily.
Величие не Бога может быть недооценена.
|
|
|
|
|
|
what is wrong with my code it's kicking me in the head right now and if a kind soul could help me out i would be very grateful, thanks.
here is the goal:
Use a one dimensional array to solve the following problem. Read in 20 numbers,
each of which is between 10 and 100, inclusive. As each number is read, print it only if it
is not a duplicate of a number already read. Provide for the “worst case” in which all 20
numbers are different. Use the smallest possible array to solve this problem.Well,
#include <iostream>
#include <iomanip>
#include <ctime>
#include <cstdlib>
#include <limits>
const int x = 20;
using namespace std;
int main()
{
int i = 0;
int toss = 0;
int count=0;
int population[20];
int num=0;
bool duplicate = false;
while(1)
{
for (int j = 0; j < x; j++)
{
srand(time(NULL));
num = rand()%90+11;
if (num == population[j])
{
duplicate = true;
toss++;
}
if (!duplicate)
{
population[j] = num;
count++;
}
}
for (int ii = 0; ii <= count; ii++)
{
cout << population[ii]<<" ";
}
cin.clear();
cin.get();
}
}
|
|
|
|
|
i think you need to re-think the problem.
here's a hint: the population array is going to start out with 0 items in it. after the first number read, it will have one item in it. after the second, it can have one or two. after the third, one, two or three. you need to keep track.
here's another hint: you're going to have two loops: one going from 0-19, to read the numbers, and another, inside the first, going from 0-N, where N is the number of items you've read and stored.
|
|
|
|
|
I turned in my assignment, but it wasn't right, so i lost some points, i was wondering if you could give an example on how to do this the right way? i apologize for asking, but my professor is very hard to understand due to the fact he is not a native speaker of English so mush of what i do know is self taught.
|
|
|
|
|
roughly, and in pseudo-code:
int storage[20]
int numStored = 0
loop 0 to 20, i
int newVal = read_a_value;
bFound = false
loop 0 to numStored
if storage[i] = newVal
bFound = true
break
.
if not bFound and numStored < 20
storage[numStored] = newVal
numStored = numStored + 1
.
|
|
|
|
|
Thanks Chris for taking your valuable time and helping me out, i really want to learn c++ and plan to take OOP next semester. so far my grades are in the low 90's and don't want to blow it towards the end of this semester.
dose all this belong in the same for loop? i am not sure what you are
saying in "read a value" could this be what you are
saying, "newVal = read_a_value[i];" or is
this it "newVal = rand()%91+10;"
how do i implement "see if you've already read that number" if after the
2nd number i will need to see if the previous number has been read and
chick if it's a duplicate. and each time a new number is generated it
must be checked to the others to see if its already there. i am having
a hard time visualizing the logic and i really do appreciate your time
to help me with this.
for loop 0 to 20, i
{
// read a value
int newVal = read_a_value;
// see if you've already read that value
bFound = false
loop 0 to numStored
if storage[i] = newVal
bFound = true
break
}
|
|
|
|
|
Omegaclass wrote: dose all this belong in the same for loop?
you'll have two loops. one inside the other.
Omegaclass wrote: i am not sure what you are saying in "read a value"
that's where you get the next input. your original msg says "Read in 20 numbers,
each of which is between 10 and 100, inclusive." so, if the test data is coming from a file, you'll need to open that file then read each number one at a time. or, if it's coming from the keyboard, or from stdin, or cin, etc..
rand() will work for testing, i guess. but that seems like a strange assignment. i know when i would get assignment like this, the instructor would have a set of data files that he'd send into the program, to make sure the app was doing what it was supposed to on known input.
Omegaclass wrote: how do i implement "see if you've already read that number" if after the 2nd number i will need to see if the previous number has been read and chick if it's a duplicate.
the previous number will be in the storage array - if it was duplicate, it was already there; if it was a new one, then you will have added it. so, you just need to loop through the items in the storage array and compare each one to the new value.
|
|
|
|