|
Seems a bit odd. I use COM on CE all the time and have never seen this problem but I suppose that's because all our stuff is multithreaded. If you have control over your CE platform it's possibly worth experimenting with putting DCOM back in. Our CE 5.0 has it, Microsoft just took it out by default because some things don't work. We have plenty of components with ThreadingModel='Both'
I would suggest you develop an empty or dummy COM object specifically targetted at CE, using the EVC4 compiler (which is fussier than the regular VC compilers) to make sure you can get the infrastructure working. Once you've got a working shell you can port the useful code into it. You could always create a free threaded component and simply wrap every entry point with the same critical section so that old single threaded code can be used internally without breaking anything. It's not highly efficient but it should work.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
I'd like to have a reliable method to find C style casts in the source code. They can't be easily detected like 'static_cast' and the other C++ cast operators.
If there is a tool that can do the job, please point me to it.
Thanks in advance for your help.
|
|
|
|
|
A C-style cast is generally in the form of (type)ValueToCast . If you are looking for things like that for code-review purposes, also watch out for temporaries that are created using the following syntax: type(ValueToCast) .
For example:
int iValueA = (int)dDoubleValue;
int iValueB = int( dDoubleValue );
FuncThatTakesACString( CString( "String Literal To Make A CString From" ) ); Things things should be rather easy to do a find-in-files search on, you can even automate VS using a macro to repeat the find using a list of types.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
That fine for intrinsic C++ type which you know exist, but how about users defined types, which you are not aware of? I think our friend wants a tool that will catch all the type cast.
Yours Truly, The One and Only!
|
|
|
|
|
Simple - you run something like Doxygen or some other documentation tool to get you all of the types that are being used by your application. You then feed that into my suggestion above.
Brute force, yes, but it works; especially when you do not what to pay money for a good code review/analysis. Hell, lint with the right rules may do it for you.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
sixio wrote: I'd like to have a reliable method to find C style casts in the source code.
That is near to impossible.
Thats why I usually use the C++-style casts: The stick out.
Failure is not an option - it's built right in.
|
|
|
|
|
you don't need to worry about non-class types casting like int, long, wchar_t, etc ... leave them as-is!
what you want to do is a search as someone else said of the form
(class name)
get a list of all the class names in your project and then to a find in file of that c-style casting!
i.e class MyClass {...};
search for "(MyClass)" in the entire solution!
Yours Truly, The One and Only!
|
|
|
|
|
Hi all,
I am facing problem in creating a file and writing to it.
The code looks like this:
TCHAR path[50];
fpLog = fopen((LPCSTR)path,"wt+");
When i am storing some predefined path in variable path.In this case the file is not created in the directory when fopen is executed but when i directly give path e.g D:\\file.txt the file is created and written also.
May be i am wrong in executing fopen.
Regards,
|
|
|
|
|
try _tfopen without casting a TCHAR to a char
|
|
|
|
|
Maynka wrote: When i am storing some predefined path in variable path.In this case the file is not created in the directory when fopen is executed but when i directly give path e.g D:\\file.txt the file is created and written also.
Are you confusing an absolute path with a relative path?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I've draw a spline in a view whose DC is in Himetric mode using GDI+.No problem is here. But when I print this same spline, it is not placed at proper location. I've observed that all points that are use for spline drawing, remain same and DC also is in HIMETRIC mode. What I have to do to solve the problem? Do I need to change the pointlist that construct the spline for printing? If so how can I do that?
|
|
|
|
|
Assuming you have the normal printing gotchas out of the way that are typical in GDI based applications, you need to ensure the GDI+ environment does not interfere with the GDI mapping routines if you are using those instead of the GDI+ transformations.
Jonathan de Halleux has some good tips about this general topic...
Tips on printing with GDI+[^]
Specifically, set
graphics.SetPageUnit(UnitPixel);
to prevent GDI+ interference in the mapping mode stuff.
Hope this helps
|
|
|
|
|
Thanks bob16972
for your help
|
|
|
|
|
hi all
i have made an application in vc++ with mysql as database
i have face a problem that it gives a problem as unhandled exception access voilation
i use debugger but i cannot solve problem becoz debugger does not show error
it show LIBMYSQL! 10007764() and i could not understand this
please help me
hi
|
|
|
|
|
paras_s12 wrote: Wow. That has absolutely nothing related to your first post
Can you post the code that does not work ?
|
|
|
|
|
if(!mysql_query(myDB,"SELECT passowrd from login WHERE user= \'" + user + "\'")
res=mysql_store_result(myDB);
if (!res)
{
MessageBox("Could not run query");
}
row = mysql_fetch_row(res);
{
i = (int) mysql_num_rows( res );
if (i != 1)
{
MessageBox("WRONG LOGIN PLEASE TRY AGAIN"," pop. ",MB_ICONASTERISK);
mysql_free_result( res ) ;
the problem is that data is not fetched
and i think exception is due to no value in res
hi
|
|
|
|
|
So why are you not stepping through this code to find the problem? The debugger is your friend. Learn to use it.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
i want to execute some code when a dialog is destroyed, but the code in DeatroyWindow() function doesn't executes when i use EndDialog() but executes when i use DestroyWindow().
What is the diff. between these two and which should be best to use?
|
|
|
|
|
I'd go for DestroyWindow(), or OnOK, OnCancel if you are using MFC. I've never done anything with EndDialog().
|
|
|
|
|
i use EndDialog()for modal dialog boxs and DestroyWindow() for modeless dialog boxes
|
|
|
|
|
Dialog Window Created by DialogBox, DialogBoxIndirect .. should be destroyed using EndDialog. OnOk, OnCancel internally uses EndDialog.
And surely OnDestroy() will get called when EndDialog is used.
Are u using MFC?
|
|
|
|
|
DestroyWindow is something you call, not something that gets called. In MFC,
CWnd::DestroyWindow() is virtual. If you've overridden it, your override will get called at the
end of DoModal() but that doesn't make it a good place to do something when a dialog is destroyed.
That's a side effect of the way MFC does modal dialogs.
I think a better place is any time at or after you receive a WM_NCDESTROY message.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
ya... i'm too thinking that...
because i've placed code in overridden DestroyWindow() function
but it never gets called if EndDialog() method is used to close the dialog box.
|
|
|
|
|
Abhijeet Pathak wrote: but it never gets called if EndDialog() method is used to close the dialog box.
Looking at the source code, that is correct
Note that when you receive WM_NCDESTROY, child windows (controls etc) have been destroyed.
If you need access to the controls before they are destroyed, respond to WM_DESTROY which is sent
before WM_NCDESTROY.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hello!
Please help me!
Whether can Windows Media Encoder read such stream:http://wm1.streaming.castor.nl/castor=castorradio
If yes that as?
If is not present, than it would be possible to read what to transfer the ambassador on processing in Windows Media Encoder?!
|
|
|
|