|
Hi!
How can I write processor specific code, like SSE/SSE2??
--------
Dave
|
|
|
|
|
either use asm code
or get a compiler that supports it
afaik
"traffic lights are for people who can't make their own decisions" biz stuff about me
|
|
|
|
|
any resoures?
--------
Dave
|
|
|
|
|
sheesh i havnt done asm coding in a while now so i dont have any sites off hand but there are loads of them
u can either do inline asm in vc++ i think or get masm (which is a free dnload from ms i think)
how to do chip specific stuff? get the data sheets from the chip makers and plow thru it
hope this helps
"traffic lights are for people who can't make their own decisions" biz stuff about me
|
|
|
|
|
OK .. I have VC.NET,
I'm working on a CAS system and I'm writing a runtime compiler. It's working fine with standard routines, but I was thinking of implementing SSE routines. But I dunno how...
--------
Dave
|
|
|
|
|
I think that the new Visual C++ 2003 should support some options for allowing the SSE/SSE2 instruction set. But I have it only from marketing blabla on Microsoft's site...
|
|
|
|
|
I took over development of a project that is a client/server design. When an order is accepted on the server an exception is thrown. This exception only happens in a release build and unfortunately has a vague message box saying "The server through an exception". How does one nail down where this exception is happening?
The only information that I have when running the app through Visual C++ 6.0 is
"First-chance exception in Inforemer.exe (KERNEL32.DLL): 0x80010105: (no name)."
Can I use this information to deduct where the exception is thrown? Otherwise how else would I track it down?
Cheers,
Clint
|
|
|
|
|
try generating .pdb files. Usually there is Dr. Watson on the server if you have pdb it could be able to safe call stack. There is also debugging tools from Microsoft (not VC studio) with the small footprint, it is safe to put on the server. The major problem you have to overcome is to setup debugger to create dump when 0x80010105 happens. If you can debug the server on the local computer you can just use VC debugger, where you can actually step through the code (even release, with some limitations).
|
|
|
|
|
I discovered how to do it. Since I can debug the server from within VC I set it up to give me a PDB in release mode. I then ran the program and went to Debug->Exceptions in the VC menu. There I was able to add the address of where the exception happened and set it to "Stop always." After generating the exception the debugger kicked in. Fabulous! Now to actually debug the problem
Cheers,
Clint
|
|
|
|
|
Hello,
I just wanted to know if the following piece of code is correct,
won't have any memory leak, will be portable, will always work, etc...
Or would you code it in another way?
static char (*g_szCMOSInfo)[MAX_CMOS_STRING];
g_szCMOSInfo = new char[NUM_CMOS_STRINGS][MAX_CMOS_STRING];
strcpy(g_szCMOSInfo[i++], "Time - Seconds");
strcpy(g_szCMOSInfo[i++], "Alarm - Seconds");
strcpy(g_szCMOSInfo[i++], "Time - Minutes");
strcpy(g_szCMOSInfo[i++], "Alarm - Minutes");
strcpy(g_szCMOSInfo[i++], "Time - Hours");
strcpy(g_szCMOSInfo[i++], "Alarm - Hours");
strcpy(g_szCMOSInfo[i++], "Date - Day Of The Week");
strcpy(g_szCMOSInfo[i++], "Date - Day");
strcpy(g_szCMOSInfo[i++], "Date - Month");
strcpy(g_szCMOSInfo[i++], "Date - Year");
SAFE_DELETE_ARRAY(g_szCMOSInfo); Where SAFE_DELETE_ARRAY is defined as:
#define SAFE_DELETE_ARRAY(p) { if((p) != NULL) { delete [] (p); (p) = NULL; } }
-Dominik
|
|
|
|
|
When are you calling SAFE_DELETE_ARRAY? if you do it as shown you will lose all those strings.
Just out of curiosity why do you need dynamic array?
|
|
|
|
|
I call SAFE_DELETE_ARRAY at the end, when I don't need the array any more... thought this would be clear
I need dynamic arrays, because my program displays large amounts of data on numerous different pages. The data is retrieved shortly before I need it to display. If all the arrays would be allocated at program start, my program would explore in memory consumption!
But is the allocation of the strings ok like that?
Thanks for your help
-Dominik
|
|
|
|
|
I feel uneasy about static global nonconst array, but your reasons sound to be solid. You have new, you have matching delete, seems OK(make sure you call delete for each new).
|
|
|
|
|
Here's an easier way:
static char g_szCMOSInfo[][MAX_CMOS_STRING] =
{
{ "Time - Seconds" },
{ "Alarm - Seconds" },
{ "Time - Minutes" },
{ "Alarm - Minutes" },
{ "Time - Hours" },
{ "Alarm - Hours" },
{ "Date - Day Of The Week" },
{ "Date - Day" },
{ "Date - Month" },
{ "Date - Year" }
};
1. It's allocated at compile time so it's very fast,
2. There are no slow heap allocations, and
3. There's no memory to clean up so no leaks to worry about.
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
(I actually prefer medium-well.)
|
|
|
|
|
Ok, but what if the strings are not known at allocation time?
The code I posted was just thought as an example. I also have to allocate more complex structures, for example 200 DDDEVICEIDENTIFIER2 structs (a DirectX structure).
|
|
|
|
|
Yeah, I just read your reply to AlexO.
Your code looks fine, although the static qualifier does not appear to be needed.
The only thing you may want to consider is that if your string values are always going to be literal strings (ie, "abc", "whatever"), then you don't even need to allocate extra space for them:
char* g_szCMOSInfo[NUM_CMOS_STRINGS];
g_szCMOSInfo[i++] = "Time - Seconds";
g_szCMOSInfo[i++] = "Alarm - Seconds";
Since the compiler has already allocated space for literal strings, all you need to do is point to them.
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
(I actually prefer medium-well.)
|
|
|
|
|
Hi,
I complided my software in DEBUG and RELEASE mode all are OK.
But when I execute my RELEASE version, an error message appears " OUT OF MEMORY".
Anyone can help me for debbugging this error or how can I do for checking my memory when I execute my software.
youssef
|
|
|
|
|
check all of your allocations - make sure you aren't trying to allocate any zero element arrays or arrays with huge numbers of elements. in other words - check that the variables you're using to control the array size (Foo *p = new Foo[arraySize];) has been intialized and has a reasonable value.
-c
I'm not the droid you're looking for.
|
|
|
|
|
Have you tried setting lpstrInitialDir to the new directory in the OPENFILENAME structure?
If I have seen further it is by standing on the shoulders of Giants. - Isaac Newton 1676
|
|
|
|
|
I allways inicialize lpstrInitialDir with my path in OPENFILENAME structure!
As I said I have the problem only at app start if the path I want to set doesn't exist anymore! (read the first code I use to solve that)
|
|
|
|
|
I am unable to see your original post, it appears to be "lost", could you check your end and re-post if necessary. Therefore I assume the problem is SetCurrentDirectory() returns TRUE but the path it is trying to set does not exist?
If so why not check the path exists or do a GetCurrentDirectory() and see if it matches where you are. Should these suggestions be totaly wrong just ignore them! I seem to remember something like this happening when I last used these functions, but I am not sure.
If I have seen further it is by standing on the shoulders of Giants. - Isaac Newton 1676
|
|
|
|
|
I solve the problem, and it was my mistake, because I tried to change the path once again with wrong path before I first use the file open/save dialog
uandrej
|
|
|
|
|
How can I send a 'Outlook-Format-Template .oft File' from a C-Programm ???
Harry Diel
|
|
|
|
|
The Problem is as follows.
If you use the Mapi32-Api with C++
The Function :
ULONG FAR PASCAL MapiSendMail( LHANDLE lhSession,
ULONG ulUIParam,
lpMapiMessage lpMessage,
FLAGS flFlags,
ULONG ulReserved);
needs to have a buffer-address for the lpMapiMessage-structure.
If you send normal Text it works.
If you open an Outlook-format-file, rubbish is displayed in the Text-Area
of the Outlook-Diaolog-Box.
If you open a *.oft File with the MS-Explorer the right Format-Text will be displayed in the Outlook-Dialog-Box.
Can anybody answer this ??
|
|
|
|
|
There are two listboxes in my app. When you click on an item in listbox 1, a list of possible options appears in LB 2. You can check these and select some. So each item in LB1 has a set of options from LB2. What I want to do is have a menu item. When you click on this menu, I want the dropdown menu to have a list of the items from LB1. When I click on any submenu item (item from LB1), I want a sub-sub menu (the one that pops up to the side) to show up with the options for that item from LB 1.
Is it possible to have this sort of menu get created? So far I've only made menus in the menu editor. Here the main menu item called "List Search Criteria" will be made by me in the editor, but when I click on it, I want the selections of the user to show up. Of course until the user has selected something, this menu item should be unresponsive. SO maybe it can say "nothing selected" or something.....
Any hints and functions that can be used to do this will be greatly appreciated.
Thanks,
Appreciate your help,
ns
|
|
|
|