|
use the <pre> tag to format your post correctly, b'cause we can't see anything on your question.
moreover, what is exactly your request ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Vectors can hold pretty much anything with a name, so if you have your struct defined like:
struct myStructure {<br />
int one;<br />
int two;<br />
int three;<br />
int four;<br />
};
then just define a vector of myStructs like so:
vector<myStructure> myVector;<br />
myVector.push_back(firstStructure);
then you can just access your data like you would with a basic array, ie
myStructure temp;<br />
temp=myVector[5];
or you can modify in place like
myVector[5].one=37;
Pretty cool stuff.
|
|
|
|
|
Hi, all!
I'm writing scatter plot program and it, uses function SetWorldTransform() to map coordinate space of whatever data I send to it onto coordinate space of the screen. The function works well, but as well as transforming coordinate space, it transforms objcects(which I draw using GDI+) in it, and I don't need that.
Is there a way to bypass transformation of graphics objects by means of GDI+ or is there any other function that does just that?
|
|
|
|
|
Hi,
I want to use templates to select one of the overloaded functions, basically I am looking for something like this
template<int v>
struct Int2Type
{
enum { value = v };
};
void Function(Int2Type<0>)
{
cout << "Function with Int2Type<0> selected"; -------------- (1)
}
void Function(Int2Type<1>)
{
cout << "Function with Int2Type<0> selected"; -------------- (2)
}
int main()
{
int iselect = GetValue();
Function(Int2Type<iselect>()); // selects (1) if iselect = 1 else selects (2)
// if iselect = 2
return 0;
}
My question is, Whether it is possible to write such a code? Or can someone suggest how to achieve the desired functionality.
Thanks in advance
|
|
|
|
|
You cannot do that: the basic problem is that overload selection takes place at compile time, whereas your iselect value is only known at run time.
So, you need some kind of dynamic dispatch framework to achieve what you're after. The following is a possibility (lacking the terseness of function overloading):
typedef void (* function_t)();
void function0(){...}
void function1(){...}
function_t function[]={&function0,&function1,...};
int main()
{
int iselect=GetValue();
function[iselect]();
} Hope this helps.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
Want a Boost forum in Code Project? Vote here[^]!
|
|
|
|
|
Hi,
I managed to implement some basic drag and drop support in my Tree Control by following the article: http://support.microsoft.com/default.aspx?scid=kb;en-us;214814 on the microsoft site.
However, I'd now like to implement automatic scrolling when the user moves the cursor to the top or end of the view. How would I go about doing this? Can anyone point me to some information?
Thanks in advance.
|
|
|
|
|
Hi guys, I wrote a ATL program (an addin) for MS Word using the article provided by Amit Dey on Outlook addins. It works fine. but the sink events only work for a single instance of Word. i want my application ( and the Sink Events) to function with multiple instances of Word. Can someone help me out? I'm not really sure what the problem is. My command bars are created on all instances of Word but nothing happens when i click them.
This how i implemented my sink event (just like Amit did it):
ATL_FUNC_INFO OnClickButtonInfo =
{CC_STDCALL,VT_EMPTY,2,{VT_DISPATCH,VT_BYREF | VT_BOOL}};
void __stdcall CAddin::OnClickButton(IDispatch*
/*Office::_CommandBarButton* */ Ctrl,
VARIANT_BOOL * CancelDefault)
{
USES_CONVERSION;
CComQIPtr<office::_commandbarbutton> pCommandBarButton(Ctrl);
//the button that raised the event. Do something with this...
MessageBox(NULL, "Clicked Button1", "OnClickButton", MB_OK);
}
Please help me with my difficulty.
Thanks
|
|
|
|
|
Hi,
I was wondering if anyone knows of a combined Tree and List view control for WTL?
The UI I want to create is a list view with three columns. The first column contains the Tree View items and the second and third columns contains properties of each tree item, which are displayed as check boxes.
Thanks in advance.
|
|
|
|
|
Here[^] you go. Although, it had repainting issues with WTL 7.1.
I can't remember the exact code for fix the repainting issue, and I don't have the source code readily available right now. But it's in the DrawItem() method. IIRC, the drawing of a tree item needs to be extended to the far right side of the client area. You'll notice the black areas created when opening tree nodes.
Other than that, I have not found any issues with the control.
Good music: In my rosary[^]
|
|
|
|
|
I was creating a COM+ class using ATL as the following. The name of the interface was called ISample. The COM+ class was named CSample.
Basically, it looks like that:
interface ISample: IUnknown{
...
}
class CSample: ISample{
...
}
After compiling, I configured CSample using component services manager.
Then, I created a very simple client to use CSample. It looked like that:
void main(){
CoInitialize(0);
{
CComPtr<isample> sample;
HRESULT hr = sample.CoCreateInstance(CLSID_CSample); // <--- I got problem here
...
}
CoUninitialize();
}
I got problem when trying to create the CSample COM+ object. I was told in hr "E_NOINTERFACE".
But if I made the ISample a dual interface, everything became OK.
My question is: Is it required that ISample must be dual or derived from IDispatch? If not, what is wrong with my program?
Thanks a lot!
|
|
|
|
|
I hope it will work.
ISamplePtr sample ;
sample.CoCreateInstance(CLSID_CSample);
bye
anjicafe
|
|
|
|
|
Hi,
I have a main window and a dialog. The dialog is meant to be a floating toolbar which appears when the main window loses focus or is minimized. When the child dialog gains focus, the title of the previously active window disappears. I use ::ShowWindow() and ::SetActiveWindow() to switch between the two.
However, if I move another window over the title bar of the inactive window the portion of the title covered will repaint itself.
Has anyone encountered this problem before? Is there a way I can force a window title to repaint itself?
Thanks in advance.
|
|
|
|
|
Suppose I want an application which takes a source file and outputs its data members and functions.
Supposed to develop into a kind of class view explorer.
Regarding parsing the source file ....
should i go for using regular expressions rules for this parsing or
should i go for a language representation in context free grammer[CFG] and use the CFG rules for parsing
or is there any other possible ideas for source file parsing
awaiting advice
fordge
|
|
|
|
|
CFG.
You could use Lex/Flex and Yacc/Bison ( ) or something like Antlr[^] ( ).
The Antlr site has several free for use grammars for different languages.
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
C++ code is hard to parse, unless you have an LL(k)-parser, IIRC. I believe ANTLR is a generalized LL(k) parser generator. But I'm unsure if there are any freely available LL(k) grammars for ISO/IEC 14882 C++.
Many class viewers do heuristic parsing, which are basically "creatively guessing" parsers. I don't think they are strict CFG parsers.
Good music: In my rosary[^]
|
|
|
|
|
I used Oscilloscope control in win32 and i always get an error while graph was plotting data
"Unhandled exception in sm85032.exe (UOPORT.DLL): 0xC0000005: Access Violation."
as i debug into the code the source of the problem was an error in freeing a "POINT" type
pointer variable in the oscilloscope header.
Would there be nay problem if i use WTL code in win32?
or is there anything i should set before accessing WTL code.
Any hints on this one.
Thanks!
|
|
|
|
|
Hi
I am writng an application in mfc which have to monitor the internet explorer
and to get the x and y coordinates of the caret position.
I already knows how to get IHTMLDocument2 from the HWND
but was not able to figure out how to get the position of the caret inside the document.
i understood that the IHTMLCaret cannot be retrieve because my application is in a different process.
So what is the solution for this
i will be very happey to hear any suggestion because i am stuck with this problem for almost two weeks
now.
|
|
|
|
|
Hi Folks,
I have a webservice written in Java successfully deployed on Tomcat 5.5.9. I have updated the server configuration file of Tomcat to support SSL communication on port 8443. After restarting the tomcat server, I am able to access the webservice also on the following URL through web-browser.
https://localhost:8443/mywebservice
As before, it is also accessible on http://localhost:8080/mywebservice.
Now, I am developing a COM client in Microsoft Visual Studio (Visual C++ 7.1) that uses this webservice. The stubs are automatically created using the tool SPROXY of Visual Studio. Everything works fine as long as I give the URL of the webservice as http://localhost:8080/mywebservice.
But, if I try to give the HTTPS URL "https://localhost:8443/mywebservice", the method invocation on the webservice fails. Infact, the call does not reach at all to the webservice. The call reaches the corresponding method in the stub file (the file generated by sproxy). In the method, it fails while executing "SendRequest" method.
While debugging, I found that SendRequest is actually routed to atlsoap.h from where it goes to "Navigate" function in atlhttp.inl. Here, it fails while executing SetDefaultURL function. The exact line where it fails is Line 2142 of atlhttp.inl, which is following:
if ( currScheme != ATL_URL_SCHEME_HTTP && !TSocketClass::SupportsScheme(currScheme) )<br />
return false;
Could anyone suggest what changes I might have to make to successfully access HTTPS URL from my COM client in the similar way I access HTTP URL ?
Thanks & Regards,
Arun Gupta
|
|
|
|
|
Have you been able to get this going? I've just looked into the issue and noted I'd have to write my own socket handler.
ed
~"Watch your thoughts; they become your words. Watch your words they become your actions.
Watch your actions; they become your habits. Watch your habits; they become your character.
Watch your character; it becomes your destiny."
-Frank Outlaw.
|
|
|
|
|
Hi,
I thought I had posted this yesterday, but it doesn't seem to have gone through. Apologies if it's a repost.
I was wondering if anyone could point me to any articles or information for WTL/ATL on how to detect if my application is already running and passing any request to open files etc. to the existing instance.
Thanks in advance.
|
|
|
|
|
|
Hi,
Thanks for the quick reply, worked like a treat. Now I need to work out how to send information to another window. I can get the HWND of the instance by using ::FindWindow() but what's the Windows way of sending information to another process? i.e. If I double-click a file associated with my program I want to use the previous instance to open it.
I tried sending a WM_NOTIFY to it, but obviously it won't work since I can't send any information across.
Thanks in advance.
|
|
|
|
|
Try WM_COPYDATA
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
|
|
|
|
|
It worked like a treat, thanks for all the help!
|
|
|
|
|
So, my co-worker and I are converting a major library to be UNICODE compatible. Now I can see specific file streams like ifstream and wifstream that are specific to single byte strings and wide character strings.
My question is, Is there a generic file stream that will compile to the appropriate character type, depending on your settings? A bit like how TCHAR will compile as a char, or a wchar_t if in UNICODE.
If there is for the file stream, is there a generic one defined for the string class as well?
I Dream of Absolute Zero
|
|
|
|