|
suguimoto wrote: for(int i = 0; i<8192; i++){
What if there are only 5, or 8193, lines in the file? It's not wise to hard-code such numbers.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
its must be huge. because it's simulating a memory in a "rom" inside a virtual processor.
i needed a function "readmemh" from verilog, but it couldnt be translated to c++, so i did it manually. this mem is going to be read a lot of times and changed a lot of times.
I think 8192 is fixed, as it was in Verilog. So i'm just gonna leave it like that
Thanks!!
|
|
|
|
|
Hello,
how to convert an CString to char* when the project is UNICODE defined?
My try is:
<code>
CString csPath = L"C:\\FolderName";
const char* acPath = (LPSTR)(LPCTSTR)csPath;
</code>
and acPath have only the first character!
thanks
break;
|
|
|
|
|
char* is ANSI
wchar_t* is UNICODE
TCHAR* is one or the other ( depending if UNICODE is defined )
change your char* to either wchar_t* or TCHAR* and it should work fine.
I would advice you to start using TCHAR and the _t**() macros, this will really help you to eliminate these prolems in the future.
|
|
|
|
|
Hello,
thanks for reply, i try to solve it!
have nice weekend!
regards
break;
|
|
|
|
|
break; wrote: acPath have only the first character!
That's because a cast isn't magic, the compiler can't read your mind and know "oh I should convert from Unicode to MBCS here". It's just doing what you've told it to. You end up with a const char* , pointing at something that is not a char , so naturally you get the wrong result.
Use the T2CA macro (or CT2CA if your compiler supports it) to do the conversion.
|
|
|
|
|
break; wrote: const char* acPath = (LPSTR)(LPCTSTR)csPath;
What are you doing here? Neither of the casts are necessary. Since you have Unicode, use:
const wchar_t* acPath = csPath;
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
When i run my application in my system the application window is looking good.But when i run my application in another system which has monitor size less than my system,scroll bar's are added both vertically and horizontally to the application window which is not looking good . Is there any way to restict the frame size auomatically during runtime so that no slide bars are added to it based on the environment in which we run.
|
|
|
|
|
When you create the main window, are the width and height parameters hard coded? If you used the resource editor the answer is probably yes. Use the function GetSystemMetrics() to find the screen size, and resize the window with SetWindowPos()
|
|
|
|
|
In SDK plateform,
How can i import a resource(say Dialog box)from a dll project to an exe project.
the aim should be not to hav the resource inside exe project, it will be included in dll project...
-- modified at 1:20 Monday 11th December, 2006
|
|
|
|
|
Can you be a little more clear about what you intend to do.
The easiest way would be to copy the resource into both projects. If the resource really is a DialogBox, then the size is not really an issue.
If you want to have a single resource and use it in both the exe and dll projects, then create a resource only dll ( a dll which contains no code and only resources ). Both projects can then load this dll and have access to the same resources.
|
|
|
|
|
Hi,
My intend is to hav that resource only in dll. the reason is memory at run time.
now by copting the resource in both project works fine, but my intention is to hav that resource in dll project only.
sir as u suggest to create a dll with resource only that i hav tried but it is giving an error 1813, using getLastError()..i.e the image file can not be find. Again i tyed to look for that image file in msdn, but didnt get proper solution..
|
|
|
|
|
All resource loading APIs take a HINSTANCE handle to the module containing the resource.
If the resource is in a dll, you use a module instance handle to the DLL.
|
|
|
|
|
hi..all
how can i use the function GetencoderClsid(L"",&CLSID);
in VC++ 6.
Please let me know about it ,it's urgent.
Thank you.
There Is Nothing Right & Wrong
|
|
|
|
|
|
What class is this method in?
|
|
|
|
|
Dear All,
I would know that what is Release mode and Debug mode ?
bye.
|
|
|
|
|
A release build is what you release to the public. A debug build is what you use when debugging. The debug version will contain a lot of extra information, hence have a larger size.
|
|
|
|
|
You can see an article about release & debug mode and different their on codeproject,search about it
|
|
|
|
|
How to pass the filename to my program on
right click a file -> select my app
I have modified the registry to show my app on menu & invoke my app.
How i pass the filename as commandline or anyother way
|
|
|
|
|
i think the file will be passed as the command line. Did u check the command line using GetCommandLine()?
nave
|
|
|
|
|
anilFirst wrote: How i pass the filename as commandline or anyother way
That's what the %1 was for that you added to the registry.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Am trying to oepn a text file( not empty file). Want to delete a specified portion of the file ( around 10 chars from the middle of the file). how can i do it? i've already calculated start position and end position. but don't know how to delete that part and again write that part.
Thanks in advance
kamalesh
|
|
|
|
|
Use feek and ftell functions.
Those two might help you.
bye.
|
|
|
|
|
One way is to read the entire file contents into a buffer, modify the buffer, and write the buffer back out to the file.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|