|
Is this a VS.NET or a VC 6 add-in?
|
|
|
|
|
VC 6
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Wouldn't you just use the IApplication pointer that gets passed to IDSAddIn::OnConnection?
|
|
|
|
|
my original problem was how to get the *.dsw file.
i saw a code that does that :
CString CCommands::GetWorkspacePath()
{
CWinApp* pApp = AfxGetApp();
ASSERT(NULL != pApp);
CString szWorkspace(_T(""));
POSITION posdt = pApp->GetFirstDocTemplatePosition();
while (NULL != posdt)
{
CDocTemplate* pdt = pApp->GetNextDocTemplate(posdt);
if (0 == strcmp("CProjectWorkspaceDocTemplate",
pdt->GetRuntimeClass()->m_lpszClassName))
{
POSITION posdoc = pdt->GetFirstDocPosition();
if (NULL == posdoc)
break;
CDocument* pdoc = pdt->GetNextDoc(posdoc);
if (NULL == pdoc)
break;
szWorkspace = pdoc->GetPathName();
if (!szWorkspace.IsEmpty())
break;
}
}
return szWorkspace;
}
trouble was that when i run this code i got NULL for this line:
POSITION posdt = pApp->GetFirstDocTemplatePosition();
that's what led me to think that the pApp is the dlls therefor it can not get the doc template (cause it doesn't have one) what it should be is the dev studio exe and have a doc template.....
can you help me here? i am really desperate no one could help me here...
thanks again
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Yaron,
While I'm not sure exactly what you're trying to accomplish, it seems to me that using the DocView hierarchy exposed by DevStudio rather than its automation interface is way more work than its worth.
The IApplication pointer that gets passed to OnConnection is a pointer to the DevStudio instance in which your add-in is running. It includes an entire COM object hierarchy that allows you navigate windows, projects, files, etc.
Look for IApplication in the DevStudio version of MSDN (not the newer MSDN that comes with VS.NET). It's got an easily navigable hierarchy that should get you where you need to be.
don
|
|
|
|
|
I know the this heirarchy, already read the MSDN,
the thing i try to accomplish is when i open a project in the dev studio then usign my add-in i want to get the entire path of the *.dsw file....
i could not find any code for doing that (getting the *.dsw file)
can you help?
thanks again
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
What does Application::ActiveProject::FullName return?
|
|
|
|
|
it returns the *.dsp name of the active project....
i can not just do concatonation like this
ProjectName.dsp --> ProjectName. --> ProjectName.dsw
because it is not insured that the name of the dsw is the name of the active project.....
"help i need sombody , help is there anybody, help you know i need some HHHEEEELLLPPP"
thanks again
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
OK, one last idea and then I'm out of suggestions:
Have you tried looping through the Application::Documents collection looking for a file with the dsw extension?
|
|
|
|
|
this i haven't tried yet, so i will try it now, but my guess is that the documents collection is empty at this stage.....but i will sure try it now and let you know
thanks for all the trouble
cheers,
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
YaronNir wrote:
i need to get a pointer the visual studio app, not the add in app,
What you describe is the difference between a MFC regular DLL and an MFC extension DLL. An extension DLL uses the CWinApp of the EXE, so that's the type of DLL you need to use.
--Mike--
Ericahist | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber
There is a saying in statistics that a million monkeys pounding on typewriters would eventually create a work of Shakespeare. Thanks to the Internet, we now know that this is not true.
|
|
|
|
|
thanks for the reply,
but when i start a visual studio add in project (using the wizard) , what options do i have???? it determines for me the type of dll it produces....
how can i bypass it?
thanks again
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Hi,
I have created Browser Helper Object(BHO) to get and handle events triggered by "Internet Explorer"(IE).
I am albe to intercept events of IE like DocumentComplete etc. Even I am getting the submit event of the form when "submit" button is clicked. But I am not been able to stop the form being submitted. May be because of when I get the submit event of the form meanwhile somebody other who is responsible for submitting the form is submitting it.(by using POST or GET method, may be browser itself is submitting the form)
Now the problem is by intercepting which event of whom i.e. of IWebBrowser2 or HTMLFormElements or any other Interface can I stop the submition of form.
I actually want to know which event is triggered, that can be caught in IDispatch::Invoke of my BHO, when form(html form) is sent to server(by POST or GET method).
Avinash D.J.
|
|
|
|
|
You can't stop the form from being submitted. You are responding to a notification that the form *has* been submitted.
|
|
|
|
|
As Terry has already pointed out, an event signalizes in this case that something has already taken place, and you cannot influence the trigger of the event in the past.
However there is a workaround, and it is called API hooking/hijacking/monitoring.
Internet Explorer uses the Wininet functions to communicate with the internet. If your user clickes the "go" button with some url in the address bar, the appropriate Wininet functions, like HttpOpenRequest and HttpSendRequest are called inside IE's code. The same applies to when the user submit a form.
If you hook into the WinInet functions from your BHO, then you will be able to monitor and "authorize" IE's actions.
Example: if your user clicked a Submit button on a form with POST action then HttpOpenRequest is called with the second parameter lpszVerb being "POST". You can take any action including stopping the process.
If a form with "GET" action is concerned, your job is a bit more difficult because the verb in this case does not differ from "ordinary" page requests. You could then take into account the url from your form, and compare it with lpszObjName (3. param of HttpOpenRequest)
If you are unfamiliar with API hooking, check out this article:
http://www.codeproject.com/useritems/api_monitoring_unleashed.asp
Peter Molnar
|
|
|
|
|
hi!
i use one pc to connect to the internet. all other pcs connect over a proxy (janaserver) to the internet-pc to get into the inet.
i try to code an small instant messanger like icq for my business. localy everything works fine! but how do i connect from my app to the internet over the proxy? it only works (of course) if i run the messanger-app on my server...
i use 2 CAsyncSockets - one for sending, one for listening. i actually use port 80 for send/listen (its easyer to handle while developement).
anyone has an idea?
sorry for my bad english. not my native language.
cheers,
vertex
|
|
|
|
|
I am not familiar with the backend of a proxy server. Nonetheless, it should not be difficult since your proxy already works. Now just allow access to the internet IP instead of the LAN IP.
Kuphryn
|
|
|
|
|
the point is, that my client/server app has to listen, if any connection comes in from the inet. but if there is a message sent from outside my lan, the message is sent to the ip of my dailup-pc. he does not know, that a client pc on the lan is waiting for the message...
|
|
|
|
|
Check this
http://www.codeproject.com/internet/casyncsocketex.asp
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
yes, found that too, but it can only receive information over proxy. but it can´t start a listening socket (a server).
im still wondering how icq makes that possible?!
i could connect to a script on an http-server and check every second, if new messages arrive - but if more than 10 users check every sec. for new msgs: - wouldn´t be a real instant messanger... hm...
but thank you anyway... (
|
|
|
|
|
Hi,
I wrote this code on CMessDlg : public CDialog
but the cursor type is not changing
What can be the reseon?
Thank you in advance,
Seval YILMAZ
OnSetCursor is trigeret on ON_WM_SETCURSOR()
HCURSOR hcrs;
BOOL CMessDlg::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
hcrs = AfxGetApp()->LoadCursor(IDC_NODROP);
CWinApp* pApp = AfxGetApp();
SetCursor( hcrs );
return CDialog::OnSetCursor(pWnd, nHitTest, message);
}
|
|
|
|
|
Did you try to set the cursor AFTER the call to the base class?
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
I have an application with a CListCtrl. Items are continuously being added to this list. When I scroll the box of the CListCtrl to the end of the scrollbar I want the list to autoscroll.
To accomplish this I retrieve the scrollbar position (GetScrollPos) and compare this to the scrollbar limit (GetScrollLimit). If there is a match is call EnsureVisible after adding an item. However when I slowly drag the box of the scrollbar, the scrollbar position will never match the scrollbar limit. It seems the limit is updated during dragging and the position is not. Anyone knows a solution for this problem?
|
|
|
|
|
Hello,
I am desperately looking for a solution in MS Chart whereby I can plot different X,Y data on a single chart. All I could figure out from various sources is different Y can be plotted for the same X axis data.
Help in any form greatly appreciated. Code snippet most welcome.
Thanks to all in advance.
|
|
|
|
|
Hi,
I need to build an app to open some kind of file (it kan be any kind: .exe .html .txt .hex --> really everything) as a binary (or hexadecimal file), after that I need to convert this file to a hexadecimal file with checksums.
I know how to do the last thing, but I could use some help in opening files as binaries!
|
|
|
|