|
It should, but I can not say it will :P
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
Thanks Nelek
I will try that.
Prithaa
Bye
|
|
|
|
|
Just one thing more, as well you should try to write new messages with new questions... if it is something related with this... please tell me here about the new message, I will have a email if something is added to this post. It is to avoid not reading a message related
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
Hi, I recently posted an article (http://www.codeproject.com/useritems/VC2003MeyersSingletonBug.asp) and one of the comments raised a question that I cannot find a definitive answer for. I'm hoping somebody can help here. The question is:
In C++, if an inline class member function that contains a local static variable is included in a header which is included in more than one CPP file, does the linker garuantee that the static variable is treated as a single instance?
So in foo.h:
class foo
{
public:
int bar()
{
static int i = 0;
++i;
return i;
}
};
And in fooA.cpp:
#include "foo.h"
extern void fooB();
int main()
{
foo f;
printf ( "%i", f.bar());
fooB();
return 0;
};
And in fooB.cpp:
#include "foo.h"
void fooB()
{
foo f;
printf ( "%i", f.bar());
};
Should I get the output:
12
Or:
11
BTW, I know what actually happens in my similar real code - I get "12" which is what I expect. But I'd like to know if this is C++ standard behaviour, undefined in the standard or just an MS compiler quirk. Thanks for reading.
|
|
|
|
|
I can't speak to the standard but the MS compiler simply ignores the inlineness of the function. In fact is never 'gaurentees' to inline anything even if you __declspec(inline) or __forceinline. This may be one of the reasons.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
FWIW, GCC seems to behave the way I expect (links the static as a single global instance) as well (also with optimisations enabled).
|
|
|
|
|
Hi,
I'm using one COM component(exe), which implements the connection points also.
I have a client which implements Sink interface . The event the server fires is a method with a single argument BSTR. When the server fires the event, client gets the notification, but the BSTR value is invalid(empty string).
The problem is also seen with ULONG parameter also(where the value is garbage). Please suggest a solution, and please suggest if it is a good idea to have parameters in the event notifications.
Also if two clients are connected to the server, only the client which caused the event to be fired is getting the notification.
Thanks and regards,
Raja Pratap.
|
|
|
|
|
It's a little while since I did any COM connection points but if your data isn't getting through then I guess it's a marshalling issue. Check you Proxy/Stub implementation. Parameters in the event notifications should definitely work.
The Server end needs a loop to notify all the clients for each event. Most of the samples leave this out as they simplify to one client.
5 years ago I had to implement reverse connection points with no documentation so I remember how painful this can be.;)
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
hi can anyone tell me any article for creating setup project(msu installaer file creation) in visual studio 2005. pls help me
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
|
that page not found. my problem is i am creating a msi package. when i install this the path where the package installed should be added in registry
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
|
Hi,
I am new to windows programming. In my code I would require to change the slider bar position (I am actually invoking the sliderbar from UI using win32 API, so I donot have source code of the application), which I have accomplished by sending message.
::SendMessage( aControlHWnd, TBM_SETPOS, (WPARAM) (BOOL) TRUE, (LPARAM)(LONG) aPosition );
The problem is with the updation of the window according to the new sliderbar position, I mean, when I change the position of the sliderbar it is changed visually, but the corresponding values in other objects (like textbox showing the value related to this sliderbar) are not updated.
To accomplish this I tried
::NotifyWinEvent( EVENT_OBJECT_VALUECHANGE, theDialogHWnd, OBJID_HSCROLL, CHILDID_SELF );
where theDialogHWnd is the handle for the dialog window containing the sliderbar and the textbox, but it didn't work. I am not sure if the parameters I am using are correct, or the event I am trying to notify, or may be my approach to the problem itself is wrong. I do understand that this can be easily accomplished by sending a keyboard or mouse event, but I am tryin not to use it.
Any help would be greatly appriciated.
Thanks.
|
|
|
|
|
When slider bars are moved they post either a WM_HSCROLL or a WM_VSCROLL to its parent. Try posting these messages to the parent window of the slider bar. To determine which message should be sent check the slider control for the style TBS_VERT.
See if something like this works:
int iPos = m_slider->GetPos();
if (m_slider->GetStyle() & TBS_VERT)
pWnd->PostMessage(WM_VSCROLL, (WPARAM)((iPos << 16) | SB_THUMBPOSITION), (LPARAM)NULL);
else
pWnd->PostMessage(WM_HSCROLL, (WPARAM)((iPos << 16) | SB_THUMBPOSITION), (LPARAM)NULL);
|
|
|
|
|
I want to know how can i make Intelliegnt Connectors,like those in MS Visio that connect 2 or more blocks and when the blocks are moved, the connectors position themselves accordingly without interferring with any other block.
Is it possible to make such connectors using VC++? I need this as i have to do a the same for my project.
Pls help
Regards
Meenu
|
|
|
|
|
Hi, it can be possible, but it will be difficult.
I would make it by setting the points where you can connect the object in an array/structure, then use some regions to know if the mouse is approaching to one of them to make the point visible when necessary and using its coordinates by clicking when it is visible.
Afterwards for the lines... this will be pretty hard (I think), at the beggining you should determine which point of your object is being used to start the line. Make a short line in this direction (if the point is at the top then a short line to north, if the point is at left, then a short line to west, and so on...). Then give priorities in directions (I mean go to the north if the object is in the lower part of the screen, go to the right if the object is on the left...). Once you have the beggining of the line, you should have a register of positions for the lines from left to right, from top to bottom (like a screen grid) and go through checking where is the next free place to draw the connection.
I can not give you any code, but the idea may be like that.
Shortly: Have a matrix to save the position of gridlines of the workspace, check where the connector is starting and go through taking dinamically the first free gridline you find towards the end of the connector. (if end is below, going down, if end is above, going up and so on)
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
Hi Nelek,
Thnx for the suggestion..
I guess something like screen grid and maintaining which gridline is free or occupied should work but i feel it will be a lot of work..!!
There may be so many blocks on the screen and no connection line should pass through any of them...
Also i want to select a connector line and delete it...I was making lines using GDI but how to handle mouse events on these lines..? Do i have to maintain the coordinates of each line also and then check if clicked point is on any line...??
i really wonder how it works in Visio...
I would try to start with this approach meanwhile if some other solution comes to your mind , pls do share..
Regards
Meenu
|
|
|
|
|
I think it will be easier if you create 2 matrix of points (one for each direction: Vert and Horz) with the index of the points (I mean: 00, 01, 02.. 10, 11, 12.. m0, m1..mn).
Afterwards you can correct the position of the click with a round to your grid unit/separation between lines (5 pixels for example). And determine the indexes of the line ends.
But yes, it will be a lot of work and considerations. The lines can be saved in a CList (take a look to my article "An addition to the Smart List" and the previous one I based mine), this will allow you to save structures or another lists to sae the corners of the lines. But you will need to check all to determine which line are you chosing to delete or modify.
I don't know how visio makes it, but I guess should be something like that.
I would make a class for the lines with methodes like IsPointInLine (CPoint point) to pass the position of the click or the mouse movement, variables like CPoint cpStart, cpEnd a list of corners... and so on.
I'm sorry not being more concret, but I will try to help you as long as I can (at least with the ideas or algorithms).
If I have another idea I will say it.
EDIT: To improve methodes I would make the list with objects but all the methodes with pointers.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
Thnx Nelek..
i will work over this and will let u know how far i m successful..
Regards
Meenu
|
|
|
|
|
hello to all of u
i have made a table in mysql which have a field doc of blob type
now i take a edit button and a button when i click on button system drive opens
and i select a document
now when i press another button names submit i want that this document is
stored in mysql but it will not stored please help me
i use this to submit:
GetDlgItemText(IDC_EDIT1,f);//doc is stored in f as i supposed
sn.Empty();
sn="insert into files values(\'" + f + "\')";
thanks
hi
|
|
|
|
|
Hi there,
My problem is that an exe file I build with VS 2005 (Professional
Edition) simply refuses to run on other computers. In fact it runs only
on machines with VS 2005 (Professional Edition) installed; on other
machines it simply says
I've checked for DLLs the program loads but it seems that they exsist on
these computers too.
If I try to start this program from from VS 2005 Express Edition, a
console window appears with this message:
Unable to start program 'E:\project\Kamicopy\Sconverter.exe'. This application has failed to start because the application configuration is incorrect.
Review the manifest file for possible errors. Reinstalling the
application may fix this problem. For more details, please see the
application event log.
---------------------------
OK
---------------------------
How can I fix this?
tuongnd
|
|
|
|
|
Tuongnd wrote: Unable to start program 'E:\project\Kamicopy\Sconverter.exe'. This application has failed to start because the application configuration is incorrect.
Rather sounds like the target computers are missing the updated C run time
Microsoft Visual C++ 2005 Redistributable Package (x86)[^]
|
|
|
|
|
I dowloaded & run setup vcredist_x86.exe but still same error?
tuongnd
|
|
|
|
|
Can you more explain about your program?
|
|
|
|
|
My program 's running on a computer. At that computer 's well run but when I copy it to other computer then rebuild has result
"========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped =========="
But I press button F5 "to run program" then appear messagebox
"Unable to start program "\..sconverter.exe this application has fail to start because the application configatution is incorrect. Review the manifest file for possible errors.Reinstalling the application may fix this prolem.For more detail see the application log".
How to fix ?
Thanks
tuongnd
|
|
|
|