|
Did it compile on the platform you've been porting it from? If it didn't it might be worth debugging it there rather than using a tool you're unfamiliar with.
Cheers,
Ash
|
|
|
|
|
I am familiar only with VS.NET environment. I was able to debug and found that dbhead.lrecl property is showing "0". Also I don't have MC6 environment.
But I am not able to guess why record length property (dbread.lrecl) is giving "0". If this has some value, then my EXE will work. Any ideas?
|
|
|
|
|
I'd look in db3_read_dic myself, that seems to be where the header's read. Start there and work out.
Cheers,
Ash
|
|
|
|
|
It is a VC++, Win32 project created in VS.NET 2005 environment.
I knew where the header is being read. But the property dbhead.lrecl itself is giving a value of 0. It is just a straight forward property...
|
|
|
|
|
Okay, so you know something's going wrong with the read. Next step is to find out what! I can't answer this as I don't have (or want) access to your data file. So have you checked...
- that the data's kosher - what you really think's in the file is in the file
- that the compiler's not making some assumptions about the size of data objects? That code looks so old it might be a 16 bit relic or the compiler may have made different assumptions about structure packing
and so on...
Cheers,
Ash
|
|
|
|
|
Hi,
I want to custome CEdit control in this way that when I select text inside edit control, selection will be an image or my own selected color combination.
Is this possible?
I dont want to color backgournd or foregroung, I just want to replace the selection color with image or any selected color......
|
|
|
|
|
Can anybody answer this question....
|
|
|
|
|
I am trying to create an application which contains non-ascii text.
I pasted an unicode string into the ide like datatype data = "வணக்கம்"; but it shows as ??????.
How to save static unicode texts?
Today's Beautiful Moments are
Tomorrow's Beautiful Memories
|
|
|
|
|
Is the source file Unicode (UTF16 or UTF8)?
Steve
|
|
|
|
|
I opened it in notepad and saved as UTF-8.
Then i opened in msdev ide.
it looks like this. MessageBox(NULL, L"வணகà¯à®•à®®à¯", L"Note", MB_OK);
Today's Beautiful Moments are
Tomorrow's Beautiful Memories
|
|
|
|
|
#include <windows.h><br />
#include <io.h><br />
#include <fcntl.h><br />
<br />
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, <br />
LPSTR lpCmdLine, int nCmdShow)<br />
{<br />
<br />
int f;<br />
f = open("c:\\uni.txt",O_RDONLY);<br />
char str[100];<br />
read(f,str,100);<br />
<br />
MessageBox(NULL, L"வணகà¯à®•à®®à¯", L"Note", MB_OK);<br />
<br />
<br />
<br />
return 0;<br />
}
i was trying to do the above but i wasnt much sure of all the type castings...
uni.txt contains the UFT chars... so i thought i can open it from a file.
Today's Beautiful Moments are
Tomorrow's Beautiful Memories
|
|
|
|
|
You can try to use string resources instead of putting the text directly in your source files. CString has a constructor that accepts an ID of a string resource.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
My program is a non MFC program. Just API's.
What should we say a non MFC program of vc++ ? any specific terminology ?
I use the word c style.
and i dont know about MFC but i use some string function using namespace STD.
Today's Beautiful Moments are
Tomorrow's Beautiful Memories
|
|
|
|
|
I am coding now.
i created a resource script and defined string entries...
i tried to past unicode text it just appeared as ???
so i opened in notepad and pasted the text and saved.
i again opened in msdev but it says file not found and some more few warning boxes.
i enabled the multiple language option in regional settings in control panel. yet
Today's Beautiful Moments are
Tomorrow's Beautiful Memories
|
|
|
|
|
Hi,
How would I take my vector of doubles and divide each element in the vector by a scalar (without using a for loop and explicitly referring to each element using the loop index)?
I tried vec/scalar but that doesn't work.
|
|
|
|
|
You can use a while loop and use an iterator to achieve this.
|
|
|
|
|
|
|
vector <double> vt;
double x;
auto it = vt.begin(); while (it != vt.end())
{
*it /= x;
it++;
}
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,
I'm getting the following error:
error C2677: binary '/=' : no global operator found which takes type 'std::vector<_Ty>' (or there is no acceptable conversion)
|
|
|
|
|
The following compiles (and runs) fine (I've a rather old VS2005 compiler...)
#include <iostream>
#include <vector>
using namespace std;
int main()
{
vector <double> vt;
vt.push_back(7.0);
vt.push_back(5.0);
vt.push_back(3.0);
double x = 5.0;
vector<double>::iterator it = vt.begin();
while (it != vt.end())
{
*it /= x;
cout << *it << endl;
it++;
}
}
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]
|
|
|
|
|
Thanks for checking, could just be some weird option in my compiler.
|
|
|
|
|
With "Mystical-Powers".
There's a reason there are iterators in STL containers: you have to iterate.
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]
|
|
|
|
|
Look at std::transform, it is your friend when you want to operate on all elements of a collection. And once you've worked out how to do that you can implement your own scalar division operator for collections:
template <typename collection>
collection operator/( const collection &c, typename collection::value_type divisor )
{
collection transformed;
std::transform( c.begin(), c.end(), std::back_inserter( transformed ), [divisor]( collection::value_type to_divide) { return to_divide/divisor } );
return transformed;
}
This code will only work on a compiler that understands lamdas - VC2008 and earlier don't so you'll have to use a separate class or function to do the fourth term of std::transform.
Cheers,
Ash
|
|
|
|