|
I thank you all for giving your response.
I do like to add i strictly cant use typecasting to change char* to unsigned char* and vice-a-versa the unsigned variables mostly contain numerics and cant afford to loose any data.
Is there however a way to typecasting without the regular (unsigned char*) and (char*)
think because thats what matters
|
|
|
|
|
I used the following code to change the alignment of an edit box:
<br />
::SetWindowLongPtrW(m_ctlMean.GetSafeHwnd(), GWL_EXSTYLE, WS_EX_LEFT);<br />
::SetWindowPos(m_ctlMean.GetSafeHwnd(), NULL, 0, 0, 0, 0, SWP_NOMOVE<br />
|SWP_NOOWNERZORDER|SWP_NOSIZE);<br />
where m_ctlMean is a variable of type CEdit...
But the alignment has no change!
Where have I done a wrong?
modified on Thursday, April 3, 2008 4:02 PM
|
|
|
|
|
Usef Marzbani wrote: Where have I done a wrong?
When you failed to read the documentation.[^]
led mike
|
|
|
|
|
Also note in the documentation (and when you are using the correct style):
"After the control has been created, these styles cannot be modified, except as noted."
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: Also note in the documentation
What, you mean you have to read all that stuff? Can't Tank just download it to me?
led mike
|
|
|
|
|
Is this what your trying to do?
LONG style=::GetWindowLong(m_edit.m_hWnd,GWL_STYLE);
style &= (~(ES_RIGHT|ES_CENTER|ES_LEFT));
style |= ES_LEFT;
::SetWindowLong(m_edit.m_hWnd,GWL_STYLE,style);
::SetWindowPos(m_edit.m_hWnd, NULL,0,0,0,0,SWP_NOMOVE|
SWP_NOOWNERZORDER|SWP_NOSIZE);
m_edit.Invalidate();
|
|
|
|
|
Or something like this?
m_edit.ModifyStyle(ES_RIGHT|ES_CENTER|ES_LEFT,ES_LEFT);
m_edit.Invalidate();
|
|
|
|
|
Hi Everyone,
There are lot of sample code for developing a custom toolbar for IE. But none for Windows Explorer . Why?.Can anyone help with a sample code for developing a toolbar for Windows Explorer?.
thanks
Nitheesh
|
|
|
|
|
Try seaching on Shell Extensions instead of toolbars.
Peace!
-=- James Please rate this message - let me know if I helped or not!<hr></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! Remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
In IE 6 and earlier, Explorer can use toolbar extensions just like IE (since they're really the same app).
|
|
|
|
|
Click here[^]
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
I have a project that is used in control and acquisitions of a system with camera and stage motor to to move the slide.
Now i am trying to optimize the system, where in i need include status function displaying the current image being scanned by camera now heres the issue although the status functions works fine but it is never displayed cause the loop runs so fast that although the dialog box pops up it is blank and cant see data in it now i need a way in which i can make the loop stop and make sure that it displays dlg box and then return to next image acquisition without too long delay. could one suggest tips. any help is highly appreciated.
regards
sunny
|
|
|
|
|
You should probably be using separate threads for the UI and the acquisition loop.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi Sunny, perhaps you could resolve your problem using a pomp of messages in the loop that hocks as heavily the application.
// Pompa dei messaggi
MSG msg;
while (::PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE))
theApp.PumpMessage();
|
|
|
|
|
I'm working on a MS Access database using the following connection string:
DRIVER={Microsoft Access Driver (*.mdb)};DBQ=the path to my *.mdb file;PWD=my password<br />
every thing goes fine until I close my app.
after closing my program, the following error occurs:
"The instruction at "0x122F450" referenced memory at "0x5214FA2". The memory could not be "read". Click on OK to terminate the program."
What should I do?
pDbState->m_henvAllConnections = SQL_NULL_HENV;
in CDatabase::Free() function
That was the line in which I encountered the crash;
modified on Thursday, April 3, 2008 1:26 PM
|
|
|
|
|
Is there no help running it in the debugger?
At crash time, you should be able to trace the call stack back to the offending line
(probably a bad pointer).
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Yes, There is.
pDbState->m_henvAllConnections = SQL_NULL_HENV;
in CDatabase::Free() function
That was the line in which I encountered the crash;
|
|
|
|
|
What value does pDbState have at this point?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I don't know!
Because thas is what I found in dbcore.cpp file while debugging my app.
|
|
|
|
|
Chances are, at the point of that failed call, either pDbState has been deleted
and/or the object containing it has been destroyed.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
But I can't make any change in those code! Those are belong to Microsoft not me!
I encounter the same error even for the following simplest code in entire world:
<code>
CMyDatabaseClass db;
db.Open();
db.Close();//<b>Immediatelly close it</b>
</code>
Please someone help me
|
|
|
|
|
The problem is maybe somewhere else.
There's only a few places where CDatabase::Free() is called from.
Try putting a breakpoint in there and see how many times it gets called.
Also try stepping through the Open() and Close() calls - anything fishy going on there?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: anything fishy going on there?
Wow, what are you thinking? One filet-o-fish coming right up! Would you like special sauce on that?
led mike
|
|
|
|
|
A Freudian Slip for sure! Now I'm hungry dammit...
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
How do I declare initialise a global variable, exported from one dll and use it from various files?
Let me be more specific. Assume that I have two libraries (i.e. dlls) in my application A & B. The A library consists of the A_1.cpp & the A_2.cpp file (among others). The B library consists of a B_1.cpp source.
The requirment is that both use a global variable A_X which is stored in the A dll.
In UNIX using gcc I declare the code in a common header A_X.h Thus the A_X.h looks like
<br />
extern int A_X; <br />
Then in library A my two sources look like
A_1.cpp source
<br />
#include "A_X.h"<br />
<br />
<br />
int A_X = 10;<br />
A_2.cpp source
<br />
#include "A_X.h"<br />
<br />
.... code using A_X;<br />
and in library B the source code of B_1.cpp is looking like
<br />
#include "A_X.h"<br />
<br />
.... code of B_1 using A_X;<br />
I have tried the following in windows
A_X.h header :
<br />
#ifdef LIB_IS_A<br />
__dllspec(dllexport) extern int A_X; <br />
#else<br />
__dllspec(dllimport) extern int A_X; <br />
#endif<br />
and the
A_1.cpp source in A dll
<br />
#include "A_X.h"<br />
<br />
<br />
__dllspec(dllexport) int A_X = 10;<br />
The rest of the sources are the same.
Although the solution worked I take the following warning in Win32 when I try to build the A.dll
A_1.obj : warning LNK4197: export "?A_X@@3IA" specified multiple times; using first specification
How can I declare my A_X to be a global variable. I.e. delcare it in a header, use it in both A.dll and B.dll, store it in A.dll once, and be able to use it by any source that I include that header?
|
|
|
|