標籤彙整: Debug

How to: Debug in Mixed Mode

Adopted from:

[1] http://msdn.microsoft.com/en-us/library/kbaht4dh.aspx

[2] http://msdn.microsoft.com/en-us/library/fz5w87ad.aspx

Introduction

A mixed-mode application is any application that combines native code (C++) with managed code (such as Visual Basic, Visual C#, or C++ that runs on the common language runtime) [2]. Debugging mixed-mode applications is largely transparent in Visual Studio; it is not too different from debugging a single-mode application [2].

Why do you debug in mixed mode?[1]

Debugging in both managed and native code is also known as mixed-mode debugging. There are two scenarios for doing so, depending on whether the DLL or the application is written in native code:

  1. The calling application that calls your DLL is written in native code. In this case your DLL is managed, and both managed and native debuggers must be enabled to debug both. You can check this in the <Project> Property Pages dialog box. How you do this depends on whether you start debugging from the DLL project or the calling application project.
  2. The calling application that calls your DLL is written in managed code and your DLL is written in native code.

How to enable mixed-mode debugging?[1]

  1. In Solution Explorer, select the project.
  2. On the View menu, click Property Pages.
  3. In the <Project> Property Pages dialog box, expand the Configuration Properties node, and then select Debugging.
  4. Set Debugger Type to Mixed.

Debugging in Android - 001

Observation

Cannot see new views(e.g. RadioGroup) after the textbox(i.e. edittext) while running my app with the following XML layout.

Code

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:padding="5dp">
   
    <EditText
        android:id="@+id/edittext"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"/>
   
   
    <RadioGroup android:id="@+id/people_radioGroup"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content">
      <RadioButton android:id="@+id/radio_red"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="Red" />
      <RadioButton android:id="@+id/radio_blue"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="Blue" />
    </RadioGroup>  
   
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Country" />
    <AutoCompleteTextView android:id="@+id/autocomplete_country"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="5dp"/>

</LinearLayout>

More Details

API Level: 8

Orientation: Vertical

Solution

The line

android:orientation="horizontal"

is incorrect.

It should be

android:orientation="vertical"

for veritcal orientation.